diff options
Diffstat (limited to 'src/error.rs')
| -rw-r--r-- | src/error.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/error.rs b/src/error.rs index bbc5413..49e1574 100644 --- a/src/error.rs +++ b/src/error.rs @@ -9,9 +9,9 @@ //! service has no fixed public domain; RFC 7807 explicitly allows `type` //! to be a relative URI reference. +use axum::Json; use axum::http::StatusCode; use axum::response::{IntoResponse, Response}; -use axum::Json; use serde::Serialize; #[derive(Serialize, utoipa::ToSchema)] @@ -28,7 +28,13 @@ pub struct ApiError { } impl ApiError { - pub fn new(status: StatusCode, code: &str, title: &str, detail: String, operation_id: &str) -> Self { + pub fn new( + status: StatusCode, + code: &str, + title: &str, + detail: String, + operation_id: &str, + ) -> Self { ApiError { r#type: format!("/errors/{code}"), title: title.to_string(), |
