You've already forked AstralRinth
forked from didirus/AstralRinth
more loggging (#4404)
This commit is contained in:
committed by
GitHub
parent
f3060cd9b4
commit
afcdb1d0a1
@@ -131,7 +131,7 @@ pub enum ApiError {
|
|||||||
PasswordHashing(#[from] argon2::password_hash::Error),
|
PasswordHashing(#[from] argon2::password_hash::Error),
|
||||||
#[error("{0}")]
|
#[error("{0}")]
|
||||||
Mail(#[from] crate::queue::email::MailError),
|
Mail(#[from] crate::queue::email::MailError),
|
||||||
#[error("Error while rerouting request: {0}")]
|
#[error("Error while rerouting request: {0:?}")]
|
||||||
Reroute(#[from] reqwest::Error),
|
Reroute(#[from] reqwest::Error),
|
||||||
#[error("Unable to read Zip Archive: {0}")]
|
#[error("Unable to read Zip Archive: {0}")]
|
||||||
Zip(#[from] zip::result::ZipError),
|
Zip(#[from] zip::result::ZipError),
|
||||||
|
|||||||
@@ -105,10 +105,20 @@ pub async fn check_form(
|
|||||||
let response = request_builder.send().await?;
|
let response = request_builder.send().await?;
|
||||||
|
|
||||||
Ok(if response.status().is_success() {
|
Ok(if response.status().is_success() {
|
||||||
let mut list_wrapper =
|
let body = response.text().await?;
|
||||||
response.json::<ListWrapper<W9FormsResponse>>().await?;
|
let serde_result =
|
||||||
|
serde_json::from_str::<ListWrapper<W9FormsResponse>>(&body);
|
||||||
|
|
||||||
Ok(list_wrapper.data.pop().map(|data| DataWrapper { data }))
|
match serde_result {
|
||||||
|
Ok(mut list_wrapper) => {
|
||||||
|
Ok(list_wrapper.data.pop().map(|data| DataWrapper { data }))
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
return Err(ApiError::InvalidInput(format!(
|
||||||
|
"Error parsing avalara1099 response: {e}. Actual response body: {body}"
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Err(response.json().await?)
|
Err(response.json().await?)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user