1 unstable release
Uses new Rust 2024
| 0.1.0 | Jan 22, 2026 |
|---|
#1698 in Rust patterns
12KB
210 lines
Dat Error, for extending Dis Error.
This crate is best when paired with thiserror and bun, with the former providing a quick
impl of std::error::Error and the latter providing a way to generate a long lived context.
Examples
Troubleshooting
E0277: the trait bound Context: From<T> is not satisfied
This error means we are unable to build an Error that is FromContexts from the
values provided to .with_contexts(). This may mean the value provided to .with_contexts()
can't be converted to the relevant Context using the From trait.
dterror should not require explicit calls to .into(), .to_owned() (for types that can be
constructed From their borrowed ref), or T::from().
Expand Example
E0277: the trait bound Error: FromContexts is not satisfied
This error means the Error type we are returning from our function does not implement
FromContexts, so it can't be built by .with_contexts(). This may mean the error type in
the function signature is not the correct type.
The compiler output will usually recommend types that implement FromContexts.
Expand Example
E0284: type annotations needed
This error means Rust is unable to determine what FromContexts error needs to be
constructed. This may mean the ? sigil was not appended to the with_contexts call.
dterror should not require explicit type annotations on .with_contexts().
Expand Example