Skip to content

Commit

Permalink
manually log errors in our SiteError ResponseError implementation
Browse files Browse the repository at this point in the history
actix's `Logger` middleware would do this too for us, but it also
logs all requests in a "web access log" style which i find personally
extremely annoying and unhelpful
  • Loading branch information
gered committed Jul 9, 2023
1 parent 672408c commit 54b4318
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ pub enum SiteError {

impl actix_web::error::ResponseError for SiteError {
fn error_response(&self) -> HttpResponse<BoxBody> {
log::error!("Error response: {:?}", self);
let status_code = self.status_code();
HttpResponse::build(status_code) //
.insert_header(ContentType::plaintext())
Expand Down

0 comments on commit 54b4318

Please sign in to comment.