Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upBacktrace/cause tunneling through trait objects #111
Comments
This comment has been minimized.
This comment has been minimized.
|
Not sure I understand, what is |
This comment has been minimized.
This comment has been minimized.
pub trait BaseChainedError: Error + 'static + Sync + Send {
fn iter(&self) -> ErrorChainIter;
fn backtrace(&self) -> Option<&Backtrace>;
}
pub trait ChainedError: BaseChainedError {
type ErrorKind;
fn from_kind(kind: Self::ErrorKind) -> Self where Self: Sized;
fn kind(&self) -> &Self::ErrorKind;
}We can't just use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sfackler commentedJan 4, 2017
•
edited
You sometimes need a layer of
Box<Error>in an API when e.g. making a pluginizable framework. You can currently propagate the cause chain up properly but not a backtrace.It would be nice if
ChainedErrorwere split with a top-level trait which just extendsErrorand hasextract_backtraceanderror_chain!were updated to allow propagation of the backtrace through it. Something like