Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the time
failure
was written,std::error::Error
has gained many of the features it was originally useful for, most notablyError::source
for type-erased error chains/cascades (with downcastsupport to recover the concrete type, if desired), and on
nightly
, backtrace support.This commit attempts to remove
failure
in a way that largely preserves the existing error handling, replacingfailure::Context
with an internalabscissa_core::error::Context
type which provides similar functionality, and more or less replaces the previousabscissa_core::error::Error
type.Additionally, it defines a
BoxError
alias for type-erased errors based on ideas from this rust-internals thread:https://internals.rust-lang.org/t/proposal-add-std-boxerror/10953/1
It's bounded as
Send + Sync + 'static
to help in multithreaded/async contexts.I'm not convinced this is good as a steady state, but rather could also be a stepping stone towards moving to some more widely supported library, as discussed in #144.