fix: handle auth errors
This commit is contained in:
parent
62f8a9210c
commit
512223fd83
1 changed files with 1 additions and 1 deletions
|
|
@ -1336,7 +1336,6 @@ impl RustyPipe {
|
||||||
.json(&token_request)
|
.json(&token_request)
|
||||||
.send()
|
.send()
|
||||||
.await?
|
.await?
|
||||||
.error_for_status()?
|
|
||||||
.json::<OauthTokenResponse>()
|
.json::<OauthTokenResponse>()
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|
@ -1742,6 +1741,7 @@ impl RustyPipeQuery {
|
||||||
StatusCode::BAD_REQUEST => {
|
StatusCode::BAD_REQUEST => {
|
||||||
Error::Extraction(ExtractionError::BadRequest(error_msg.unwrap_or_default()))
|
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()),
|
_ => Error::HttpStatus(status.as_u16(), error_msg.unwrap_or_default()),
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Reference in a new issue