Update deps

This commit is contained in:
Dominik Werder
2024-07-04 10:23:01 +02:00
parent 584d977675
commit 06ac90aa70
31 changed files with 362 additions and 778 deletions
+2 -1
View File
@@ -21,8 +21,9 @@ regex = "1.9.1"
http = "1.0.0"
hyper = "1.0.1"
thiserror = "=0.0.1"
#thiserror = "1"
anyhow = "1.0"
tokio = "1"
[patch.crates-io]
thiserror = { git = "https://github.com/dominikwerder/thiserror.git" }
thiserror = { git = "https://github.com/dominikwerder/thiserror.git", branch = "cstm" }
+17 -3
View File
@@ -1,10 +1,21 @@
//! Error handling and reporting.
#[macro_export]
macro_rules! err_dbg_dis {
($tt:ty, $nn:expr) => {
impl ::core::fmt::Display for $tt {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
write!(fmt, "{}::{:?}", $nn, self)
}
}
};
}
pub use anyhow;
pub use thiserror;
pub use thiserror::Error as ThisError;
pub use thiserror::UserErrorClass;
pub use thiserror::UserErrorContent;
// pub use thiserror::UserErrorClass;
// pub use thiserror::UserErrorContent;
pub mod bt {
pub use backtrace::Backtrace;
@@ -525,19 +536,22 @@ mod test {
use super::*;
#[derive(Debug, ThisError, Serialize, Deserialize)]
#[cstm(name = "SomeErrorEnumA")]
enum SomeErrorEnumA {
BadCase,
WithStringContent(String),
#[error("bad: {0}")]
// #[error("bad: {0}")]
WithStringContentFmt(String),
}
#[derive(Debug, ThisError, Serialize, Deserialize)]
#[cstm(name = "SomeErrorEnumB0")]
enum SomeErrorEnumB0 {
FromA(#[from] SomeErrorEnumA),
}
#[derive(Debug, ThisError, Serialize, Deserialize)]
#[cstm(name = "SomeErrorEnumB1")]
enum SomeErrorEnumB1 {
FromA(#[from] SomeErrorEnumA),
#[error("caffe")]