mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 05:14:27 +01:00
reponse error payload
This commit is contained in:
parent
e2546f2646
commit
4254cfbce5
@ -204,11 +204,12 @@ impl fmt::Display for Error {
|
|||||||
|
|
||||||
impl aweb::error::ResponseError for ResponseError {
|
impl aweb::error::ResponseError for ResponseError {
|
||||||
fn error_response(&self) -> aweb::HttpResponse {
|
fn error_response(&self) -> aweb::HttpResponse {
|
||||||
let error_code = self.inner.error_code().internal();
|
let error_code = self.inner.error_code();
|
||||||
ResponseBuilder::new(self.status_code()).json(json!({
|
ResponseBuilder::new(self.status_code()).json(json!({
|
||||||
"message": self.to_string(),
|
"message": self.to_string(),
|
||||||
"errorCode": error_code,
|
"errorCode": error_code.name(),
|
||||||
"errorLink": format!("docs.meilisearch.come/error/{}", error_code),
|
"errorType": error_code.r#type(),
|
||||||
|
"errorLink": error_code.url(),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user