Skip to content

Commit

Permalink
Added logging for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKrol committed Feb 22, 2025
1 parent 93f02be commit 29a5e75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/src/handlers_prelude/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use color_eyre::{
Report,
};
use reqwest::StatusCode;
use tracing::{debug, trace};
use tracing::{debug, error, trace};

use crate::{db::User, perms::Permission, AppState};

Expand All @@ -47,6 +47,7 @@ impl ApiError {

impl IntoResponse for ApiError {
fn into_response(self) -> Response {
error!(error = %self.error, "Error returned from handler");
let status = self.status.unwrap_or(StatusCode::INTERNAL_SERVER_ERROR);
(status, self.error.to_string()).into_response()
}
Expand Down

0 comments on commit 29a5e75

Please sign in to comment.