diff options
author | Santo Cariotti <santo@dcariotti.me> | 2021-03-14 12:55:21 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2021-03-14 12:55:21 +0100 |
commit | 6acc53da212e7506fd33534fd5cf9baa0d01e4ea (patch) | |
tree | fa9c35bace83a46f74ae11ad23eb58f47eba2161 /src/errors.rs | |
parent | f7932c366bab2f5d0726f4d1cdf5b9dbeddf92eb (diff) |
chore: add docs
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(), |