From 95c71a2ed5c9aecda01a90bca4b46d2e0160a106 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Thu, 23 Feb 2023 17:12:59 +0100 Subject: [PATCH] Document errors --- src/errors.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 0c56fcf..140598a 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -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()