mirror of
https://github.com/aljazceru/pubky-core.git
synced 2026-01-06 07:44:33 +01:00
Merge pull request #60 from pubky/fix/propagate-non-2xx-http-errors
fix: return an error for non-2xx responses using error_for_status()
This commit is contained in:
@@ -143,11 +143,14 @@ impl PubkyClient {
|
||||
path_segments.push(&channel_id);
|
||||
drop(path_segments);
|
||||
|
||||
self.request(Method::POST, callback)
|
||||
let response = self
|
||||
.request(Method::POST, callback)
|
||||
.body(encrypted_token)
|
||||
.send()
|
||||
.await?;
|
||||
|
||||
response.error_for_status()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user