Closed colin-kiegel closed 8 years ago
PS:
GeneralizeTo
has disappeared. In this model we can just use Into
ErrorExt
for T: std::error::Error
adds conversion to Traced<T: Error>
try_traced!
and traced_err!
pub trait ErrorExt: Error {
/// Returns generic twig error for this error code.
/// You must provide the location, where the error occured.
fn at(self, location: Location) -> Traced<Self>
where Self: Sized
{
Traced::new(self, location)
}
}
impl<T> ErrorExt for T where T: Error {}
OK, let's try this.
New suggestion for #1