Remove old thiserror
This commit is contained in:
@@ -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"
|
||||
|
||||
29
src/lib.rs
29
src/lib.rs
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user