diff --git a/tower-http/src/trace/body.rs b/tower-http/src/trace/body.rs index d713f243..32d6d8eb 100644 --- a/tower-http/src/trace/body.rs +++ b/tower-http/src/trace/body.rs @@ -62,6 +62,13 @@ where let frame = match frame.into_trailers() { Ok(trailers) => { + if let Some((classify_eos, mut on_failure)) = + this.classify_eos.take().zip(this.on_failure.take()) + { + if let Err(failure_class) = classify_eos.classify_eos(Some(&trailers)) { + on_failure.on_failure(failure_class, latency, this.span); + } + } if let Some((on_eos, stream_start)) = this.on_eos.take() { on_eos.on_eos(Some(&trailers), stream_start.elapsed(), this.span); }