rust-lang-deprecated / error-chain

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

Allow skipping the `Msg` variant #228

Closed sgrif closed 5 years ago

sgrif commented 6 years ago

While the Msg variant may be a useful option for some users, many will prefer to stick to more descriptive error types, and won't want this variant present. This allows a skip_msg_variant flag to be passed to error_chain!, which will cause no Msg variant to be present in the generated code.

I've also refactored the body of impl_error_chain_processing to not care about the number of arguments other than the final branch, so more cases can be added in the future without having to touch as many places as I did.

Fixes #200.

Yamakaky commented 6 years ago

Seems nice! Could you update the doc?

Yamakaky commented 6 years ago

Sorry for the delay, could you rebase?

AndyGauge commented 5 years ago

Thanks! I like it.