Remove old thiserror

This commit is contained in:
Dominik Werder
2025-05-26 10:36:13 +02:00
parent 3342141550
commit 60c042a972
2 changed files with 16 additions and 22 deletions

View File

@@ -1,8 +1,8 @@
[package]
name = "daqbuf-err"
version = "0.0.6"
version = "0.0.7"
authors = ["Dominik Werder <dominik.werder@gmail.com>"]
edition = "2021"
edition = "2024"
[lib]
doctest = false
@@ -18,8 +18,5 @@ chrono = { version = "0.4.26", features = ["serde"] }
url = { version = "2.5.3", default-features = false }
regex = "1.9.1"
http = "1.0.0"
thiserror = "=0.0.1"
anyhow = "1.0"
[patch.crates-io]
thiserror = { git = "https://github.com/dominikwerder/thiserror.git", branch = "cstm" }
autoerr = "0.0.3"

View File

@@ -12,10 +12,6 @@ macro_rules! err_dbg_dis {
}
pub use anyhow;
pub use thiserror;
pub use thiserror::Error as ThisError;
// pub use thiserror::UserErrorClass;
// pub use thiserror::UserErrorContent;
pub mod bt {
pub use backtrace::Backtrace;
@@ -34,19 +30,20 @@ use std::sync::PoisonError;
pub type Res2<T> = anyhow::Result<T>;
#[derive(Debug, ThisError)]
pub enum ErrA {
#[error("bad-A")]
Bad,
}
autoerr::create_error_v1!(
name(ErrA, "ErrA"),
enum variants {
Bad,
},
);
#[derive(Debug, ThisError)]
pub enum ErrB {
#[error("worse-B")]
Worse,
#[error("FromArrA")]
ErrA(#[from] ErrA),
}
autoerr::create_error_v1!(
name(ErrB, "ErrB"),
enum variants {
Worse,
ErrA(#[from] ErrA),
},
);
fn f_a() -> Result<u32, ErrA> {
Err(ErrA::Bad)