1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2025-04-06 10:09:44 +00:00

Logger middleware: don't log 500 internal server errors, as Actix now logs them always

This commit is contained in:
Rotem Yaari 2019-07-18 09:18:35 +03:00
parent b5066e8fc5
commit dd55617edc

View file

@ -15,7 +15,7 @@ use time;
use crate::dev::{BodySize, MessageBody, ResponseBody};
use crate::error::{Error, Result};
use crate::http::{HeaderName, HttpTryFrom};
use crate::http::{HeaderName, HttpTryFrom, StatusCode};
use crate::service::{ServiceRequest, ServiceResponse};
use crate::HttpResponse;
@ -204,7 +204,9 @@ where
let res = futures::try_ready!(self.fut.poll());
if let Some(error) = res.response().error() {
debug!("Error in response: {:?}", error);
if res.response().head().status != StatusCode::INTERNAL_SERVER_ERROR {
debug!("Error in response: {:?}", error);
}
}
if let Some(ref mut format) = self.format {