fix: handle auth errors

This commit is contained in:
ThetaDev 2024-10-24 01:40:56 +02:00
parent 62f8a9210c
commit 512223fd83
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6

View file

@ -1336,7 +1336,6 @@ impl RustyPipe {
.json(&token_request)
.send()
.await?
.error_for_status()?
.json::<OauthTokenResponse>()
.await?;
@ -1742,6 +1741,7 @@ impl RustyPipeQuery {
StatusCode::BAD_REQUEST => {
Error::Extraction(ExtractionError::BadRequest(error_msg.unwrap_or_default()))
}
StatusCode::UNAUTHORIZED => Error::Auth(AuthError::NoLogin),
_ => Error::HttpStatus(status.as_u16(), error_msg.unwrap_or_default()),
})
} else {