commandspec icon indicating copy to clipboard operation
commandspec copied to clipboard

Port to anyhow/thiserror

Open cgwalters opened this issue 5 years ago • 0 comments

The failure crate isn't being actively developed anymore; having it as a dependency in the public API is a problem for consumers that don't use it.

Instead, use anyhow/thiserror; in particular the public API for errors now implements std::error::Error, which allows consuming applications to e.g. directly use ? rather than needing a .map_err(|e| e.compat()).

As the docs for thiserror say:

Thiserror deliberately does not appear in your public API. You get the same thing as if you had written an implementation of std::error::Error by hand, and switching from handwritten impls to thiserror or vice versa is not a breaking change.

And we're only using anyhow internally.

cgwalters avatar Mar 12 '20 17:03 cgwalters