You've already forked 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),
|
||||
#[error("{0}")]
|
||||
Mail(#[from] crate::queue::email::MailError),
|
||||
#[error("Error while rerouting request: {0}")]
|
||||
#[error("Error while rerouting request: {0:?}")]
|
||||
Reroute(#[from] reqwest::Error),
|
||||
#[error("Unable to read Zip Archive: {0}")]
|
||||
Zip(#[from] zip::result::ZipError),
|
||||
|
||||
@@ -105,10 +105,20 @@ pub async fn check_form(
|
||||
let response = request_builder.send().await?;
|
||||
|
||||
Ok(if response.status().is_success() {
|
||||
let mut list_wrapper =
|
||||
response.json::<ListWrapper<W9FormsResponse>>().await?;
|
||||
let body = response.text().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 {
|
||||
Err(response.json().await?)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user