manually log errors in our SiteError ResponseError implementation

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
This commit is contained in:
Gered 2023-07-09 14:05:12 -04:00
parent 672408c3eb
commit 54b431810e

View file

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