rust-lang-deprecated / error-chain

Error boilerplate for Rust
Apache License 2.0
730 stars 111 forks source link

Reference description in display #234

Open kc1212 opened 7 years ago

kc1212 commented 7 years ago

Hi, is it possible to get a reference to the description string in error_chain? I want to do the following for example:

error_chain!{
    errors {
        Foo(details: String) {
            description("foo happened")
            display("{}: {}", description, details) // description should be what is in description(..) above
        }
    }
}