Loading Cargo.toml +3 −0 Original line number Diff line number Diff line Loading @@ -6,3 +6,6 @@ resolver = "2" edition = "2021" repository = "https://github.com/Nugine/s3s" license = "Apache-2.0" [profile.release] debug = "line-tables-only" crates/s3s-test/Cargo.toml +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ indexmap = "2.6.0" colored = "2.1.0" regex = "1.11.0" nugine-rust-utils = "0.3.1" backtrace = "0.3.74" [dependencies.aws-config] version = "1.5.8" Loading crates/s3s-test/src/error.rs +15 −0 Original line number Diff line number Diff line use std::env; use std::fmt; pub type Result<T = (), E = Failed> = std::result::Result<T, E>; Loading @@ -12,6 +13,20 @@ where E: std::error::Error + Send + Sync + 'static, { fn from(source: E) -> Self { if env::var("RUST_BACKTRACE").is_ok() { eprintln!("Failed: {source}"); eprintln!("Backtrace:\n"); backtrace::trace(|frame| { backtrace::resolve_frame(frame, |symbol| { if let (Some(name), Some(filename), Some(colno)) = (symbol.name(), symbol.filename(), symbol.colno()) { if filename.components().any(|c| c.as_os_str().to_str() == Some("s3s")) { eprintln!("{name}\n at {}:{colno}\n", filename.display()); } } }); true }); } Self { source: Some(Box::new(source)), } Loading Loading
Cargo.toml +3 −0 Original line number Diff line number Diff line Loading @@ -6,3 +6,6 @@ resolver = "2" edition = "2021" repository = "https://github.com/Nugine/s3s" license = "Apache-2.0" [profile.release] debug = "line-tables-only"
crates/s3s-test/Cargo.toml +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ indexmap = "2.6.0" colored = "2.1.0" regex = "1.11.0" nugine-rust-utils = "0.3.1" backtrace = "0.3.74" [dependencies.aws-config] version = "1.5.8" Loading
crates/s3s-test/src/error.rs +15 −0 Original line number Diff line number Diff line use std::env; use std::fmt; pub type Result<T = (), E = Failed> = std::result::Result<T, E>; Loading @@ -12,6 +13,20 @@ where E: std::error::Error + Send + Sync + 'static, { fn from(source: E) -> Self { if env::var("RUST_BACKTRACE").is_ok() { eprintln!("Failed: {source}"); eprintln!("Backtrace:\n"); backtrace::trace(|frame| { backtrace::resolve_frame(frame, |symbol| { if let (Some(name), Some(filename), Some(colno)) = (symbol.name(), symbol.filename(), symbol.colno()) { if filename.components().any(|c| c.as_os_str().to_str() == Some("s3s")) { eprintln!("{name}\n at {}:{colno}\n", filename.display()); } } }); true }); } Self { source: Some(Box::new(source)), } Loading