Skip to content

Commit

Permalink
feat: error_for_status
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 committed Jun 27, 2024
1 parent 0e87706 commit 99cdf1e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions azalea-auth/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ async fn auth_with_minecraft(
}))
.send()
.await?
.error_for_status()?
.json::<MinecraftAuthResponse>()
.await?;
tracing::trace!("{:?}", res);
Expand Down Expand Up @@ -584,6 +585,7 @@ pub async fn check_ownership(
.header("Authorization", format!("Bearer {minecraft_access_token}"))
.send()
.await?
.error_for_status()?
.json::<GameOwnershipResponse>()
.await?;
tracing::trace!("{:?}", res);
Expand All @@ -609,6 +611,7 @@ pub async fn get_profile(
.header("Authorization", format!("Bearer {minecraft_access_token}"))
.send()
.await?
.error_for_status()?
.json::<ProfileResponse>()
.await?;
tracing::trace!("{:?}", res);
Expand Down

0 comments on commit 99cdf1e

Please sign in to comment.