Skip to content

Commit

Permalink
Merge pull request #60 from pubky/fix/propagate-non-2xx-http-errors
Browse files Browse the repository at this point in the history
fix: return an error for non-2xx responses using error_for_status()
  • Loading branch information
Nuhvi authored Dec 11, 2024
2 parents 857ab88 + 980bee2 commit f306f33
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pubky/src/shared/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

Expand Down

0 comments on commit f306f33

Please sign in to comment.