diff options
Diffstat (limited to 'src/errors.rs')
-rw-r--r-- | src/errors.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/errors.rs b/src/errors.rs index 082315e..07df840 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -72,6 +72,8 @@ impl ResponseError for AppError { AppErrorType::NotFoundError => StatusCode::NOT_FOUND, } } + + /// Returns a JSON response with "detail" as key fn error_response(&self) -> HttpResponse { HttpResponse::build(self.status_code()).json(AppErrorResponse { detail: self.message(), |