mirror of
https://github.com/TeamPiped/piped-proxy.git
synced 2025-01-06 01:20:33 +05:30
Add error logging for UMP Transforming Errors in the transformed stream
This commit is contained in:
parent
437ee17508
commit
7c72df8f0d
@ -14,7 +14,7 @@ use std::{env, io};
|
|||||||
#[cfg(not(any(feature = "reqwest-native-tls", feature = "reqwest-rustls")))]
|
#[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");
|
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"))]
|
#[cfg(any(feature = "webp", feature = "avif", feature = "qhash"))]
|
||||||
use tokio::task::spawn_blocking;
|
use tokio::task::spawn_blocking;
|
||||||
use ump_stream::UmpTransformStream;
|
use ump_stream::UmpTransformStream;
|
||||||
@ -448,6 +448,11 @@ async fn index(req: HttpRequest) -> Result<HttpResponse, Box<dyn Error>> {
|
|||||||
}
|
}
|
||||||
let resp = resp.map_err(|e| io::Error::new(ErrorKind::Other, e));
|
let resp = resp.map_err(|e| io::Error::new(ErrorKind::Other, e));
|
||||||
let transformed_stream = UmpTransformStream::new(resp);
|
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));
|
return Ok(response.streaming(transformed_stream));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user