mirror of
https://github.com/actix/actix-web.git
synced 2025-04-08 10:54:06 +00:00
Log error results in Logger middleware (closes #938)
This commit is contained in:
parent
b36fdc46db
commit
9d7732e2d8
1 changed files with 5 additions and 0 deletions
|
@ -9,6 +9,7 @@ use actix_service::{Service, Transform};
|
|||
use bytes::Bytes;
|
||||
use futures::future::{ok, FutureResult};
|
||||
use futures::{Async, Future, Poll};
|
||||
use log::debug;
|
||||
use regex::Regex;
|
||||
use time;
|
||||
|
||||
|
@ -202,6 +203,10 @@ where
|
|||
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
|
||||
let res = futures::try_ready!(self.fut.poll());
|
||||
|
||||
if let Some(error) = res.response().error() {
|
||||
debug!("Error in response: {:?}", error);
|
||||
}
|
||||
|
||||
if let Some(ref mut format) = self.format {
|
||||
for unit in &mut format.0 {
|
||||
unit.render_response(res.response());
|
||||
|
|
Loading…
Reference in a new issue