Document errors
This commit is contained in:
parent
7992857e5f
commit
95c71a2ed5
1 changed files with 6 additions and 2 deletions
|
@ -1,11 +1,15 @@
|
|||
use axum::http::StatusCode;
|
||||
use axum::response::{IntoResponse, Response};
|
||||
use axum::{
|
||||
http::StatusCode,
|
||||
response::{IntoResponse, Response},
|
||||
};
|
||||
use tracing::error;
|
||||
|
||||
/// App error for conversion to anyhow error.
|
||||
pub struct AppError(anyhow::Error);
|
||||
|
||||
impl IntoResponse for AppError {
|
||||
fn into_response(self) -> Response {
|
||||
// Log error.
|
||||
error!("{:?}", self.0);
|
||||
|
||||
StatusCode::BAD_REQUEST.into_response()
|
||||
|
|
Loading…
Reference in a new issue