Skip to content

Releases: dtolnay/thiserror

1.0.29

05 Sep 04:08
1.0.29
c7dd271
Compare
Choose a tag to compare
  • Support error types containing generic type parameters (#148, #149, #150, #151)

    use thiserror::Error;
    
    #[derive(Error, Debug)]
    pub enum MyError<E, F, G> {
        #[error("thing {0} ({0:?})")]
        Variant(E),
        #[error("some error")]
        Delegate(#[source] SomeError<F>),
        #[error("err 0o{val:o}")]
        Octal { val: G },
    }

    In the above example, thiserror would automatically generate the following pair of generic trait impls.

    impl<E, F, G> std::error::Error for MyError<E, F, G>
    where
        SomeError<F>: std::error::Error + 'static,
        Self: std::fmt::Debug + std::fmt::Display;
    
    impl<E, F, G> std::fmt::Display for MyError<E, F, G>
    where
        E: std::fmt::Debug + std::fmt::Display,
        G: std::fmt::Octal;

1.0.28

28 Aug 23:08
1.0.28
b47c75d
Compare
Choose a tag to compare
  • Make ? work with error types that hold an optional source (#147)

1.0.27

28 Aug 21:19
1.0.27
b087faf
Compare
Choose a tag to compare
  • Support forwarding backtrace method to source's backtrace method (#137, #146, thanks @astraw)

1.0.26

03 Jul 04:13
1.0.26
031fea6
Compare
Choose a tag to compare

1.0.25

22 May 21:34
1.0.25
19cb5ce
Compare
Choose a tag to compare
  • Support error(transparent) on errors containing a non-'static inner error (#113)

1.0.24

19 Feb 04:28
1.0.24
1b0a849
Compare
Choose a tag to compare

1.0.23

27 Dec 01:39
1.0.23
d263b4b
Compare
Choose a tag to compare
  • Better diagnostic when putting non-static lifetimes into the source type of an error (#115, #116)

1.0.22

04 Nov 00:50
1.0.22
09f247a
Compare
Choose a tag to compare
  • Fix raw identifier fields in format arguments (#108, thanks @ninevra)

    #[derive(Error, Debug)]
    #[error("raw identifier: {r#type}")]
    pub struct Error {
        r#type: i32,
    }
  • Fix Rust keyword named format arguments (#109)

    #[derive(Error, Debug)]
    #[error("keyword: {type}", type = 1)]
    pub struct Error;

1.0.21

07 Oct 00:00
1.0.21
f757a04
Compare
Choose a tag to compare
  • Support capturing backtraces inside of Arc from a From impl, which makes it possible for errors having backtraces to be clonable (#102)

    use std::backtrace::Backtrace;
    use std::sync::Arc;
    use thiserror::Error;
    
    #[derive(Error, Debug, Clone)]
    #[error("...")]
    pub struct ClonableErrorWithBacktrace {
        #[from]
        source: Inner,
        #[backtrace]
        backtrace: Arc<Backtrace>,
    }

1.0.20

15 Jun 23:23
1.0.20
42b537a
Compare
Choose a tag to compare
  • Resolve unused_qualifications lint in generated code (#91)