forked from mirrors/relay
Add URL to statuscode error
This commit is contained in:
parent
8d493f35a8
commit
be07ee0177
2 changed files with 5 additions and 5 deletions
|
@ -93,8 +93,8 @@ pub enum MyError {
|
|||
#[error("Couldn't receive request response from {0}, {1}")]
|
||||
ReceiveResponse(String, String),
|
||||
|
||||
#[error("Response has invalid status code, {0}")]
|
||||
Status(StatusCode),
|
||||
#[error("Response from {0} has invalid status code, {1}")]
|
||||
Status(String, StatusCode),
|
||||
|
||||
#[error("Expected an Object, found something else")]
|
||||
ObjectFormat,
|
||||
|
|
|
@ -107,7 +107,7 @@ impl Requests {
|
|||
}
|
||||
}
|
||||
|
||||
return Err(MyError::Status(res.status()));
|
||||
return Err(MyError::Status(url.to_string(), res.status()));
|
||||
}
|
||||
|
||||
let body = res
|
||||
|
@ -163,7 +163,7 @@ impl Requests {
|
|||
}
|
||||
}
|
||||
|
||||
return Err(MyError::Status(res.status()));
|
||||
return Err(MyError::Status(url.to_string(), res.status()));
|
||||
}
|
||||
|
||||
let bytes = match res.body().limit(1024 * 1024 * 4).await {
|
||||
|
@ -216,7 +216,7 @@ impl Requests {
|
|||
}
|
||||
}
|
||||
}
|
||||
return Err(MyError::Status(res.status()));
|
||||
return Err(MyError::Status(inbox.to_string(), res.status()));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue