From 6acc53da212e7506fd33534fd5cf9baa0d01e4ea Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Sun, 14 Mar 2021 12:55:21 +0100 Subject: chore: add docs --- src/errors.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/errors.rs') 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(), -- cgit v1.2.3-18-g5258