summaryrefslogtreecommitdiff
path: root/src/errors.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-03-14 12:55:21 +0100
committerSanto Cariotti <santo@dcariotti.me>2021-03-14 12:55:21 +0100
commit6acc53da212e7506fd33534fd5cf9baa0d01e4ea (patch)
treefa9c35bace83a46f74ae11ad23eb58f47eba2161 /src/errors.rs
parentf7932c366bab2f5d0726f4d1cdf5b9dbeddf92eb (diff)
chore: add docs
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs2
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(),