From 4254cfbce532f48d794e11f527dd60037ee27a8d Mon Sep 17 00:00:00 2001 From: mpostma Date: Tue, 26 May 2020 13:41:12 +0200 Subject: [PATCH] reponse error payload --- meilisearch-http/src/error.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/meilisearch-http/src/error.rs b/meilisearch-http/src/error.rs index 14d5f33e8..75567087d 100644 --- a/meilisearch-http/src/error.rs +++ b/meilisearch-http/src/error.rs @@ -204,11 +204,12 @@ impl fmt::Display for Error { impl aweb::error::ResponseError for ResponseError { 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!({ "message": self.to_string(), - "errorCode": error_code, - "errorLink": format!("docs.meilisearch.come/error/{}", error_code), + "errorCode": error_code.name(), + "errorType": error_code.r#type(), + "errorLink": error_code.url(), })) }