You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 16, 2021. It is now read-only.
One thing I really dislike about error_chain compared to quick_error is the inability to add a custom description and format to foreign_link errors (and regular links as well, actually).
The docs suggest using chain_err, but this looses the type information for the cause, which is not ideal, and you have to implement From manually.
Any plans to add that functionality?
error_chain!{
foreign_links {Io(e:::std::io::Error){
description("disk_io")
display("Could not read/write from disk: '{}'", e)}}}
The text was updated successfully, but these errors were encountered:
theduke
changed the title
Foreign links and custom description / display
Links and custom description / display
Feb 7, 2017
cause() and from() don't do anything in error-chain. You can remove them.
>you need to implement From manually.
Why do you need to implement manually? If you're talking about an impl for io::Error -> Error, it's unnecessary since impls for io::Error -> ErrorKind and ErrorKind -> Error are already generated.
Edit: Sorry, I misread that you switched to using custom links in your second post.
Uh oh!
There was an error while loading. Please reload this page.
One thing I really dislike about
error_chain
compared toquick_error
is the inability to add a custom description and format to foreign_link errors (and regular links as well, actually).The docs suggest using
chain_err
, but this looses the type information for the cause, which is not ideal, and you have to implementFrom
manually.Any plans to add that functionality?
The text was updated successfully, but these errors were encountered: