From 7c72df8f0d99a88482f7e7c148f266cbe80b3b2b Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Thu, 14 Dec 2023 22:48:39 +0000 Subject: [PATCH] Add error logging for UMP Transforming Errors in the transformed stream --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 02f9940..97c858b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,7 @@ use std::{env, io}; #[cfg(not(any(feature = "reqwest-native-tls", feature = "reqwest-rustls")))] compile_error!("feature \"reqwest-native-tls\" or \"reqwest-rustls\" must be set for proxy to have TLS support"); -use futures_util::{TryStreamExt}; +use futures_util::TryStreamExt; #[cfg(any(feature = "webp", feature = "avif", feature = "qhash"))] use tokio::task::spawn_blocking; use ump_stream::UmpTransformStream; @@ -448,6 +448,11 @@ async fn index(req: HttpRequest) -> Result> { } let resp = resp.map_err(|e| io::Error::new(ErrorKind::Other, e)); let transformed_stream = UmpTransformStream::new(resp); + // print errors + let transformed_stream = transformed_stream.map_err(|e| { + eprintln!("UMP Transforming Error: {}", e); + e + }); return Ok(response.streaming(transformed_stream)); }