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:
Nuh
2024-12-12 00:38:38 +03:00
committed by GitHub

View File

@@ -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(())
}