mirror of https://github.com/zkat/miette.git
fix(protocol): implement source/cause for Box<dyn Diagnostic>
This commit is contained in:
parent
2c43740346
commit
c3505fac26
|
|
@ -52,7 +52,15 @@ pub trait Diagnostic: std::error::Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::error::Error for Box<dyn Diagnostic> {}
|
impl std::error::Error for Box<dyn Diagnostic> {
|
||||||
|
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||||
|
(**self).source()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn cause(&self) -> Option<&dyn std::error::Error> {
|
||||||
|
self.source()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T: Diagnostic + Send + Sync + 'static> From<T>
|
impl<T: Diagnostic + Send + Sync + 'static> From<T>
|
||||||
for Box<dyn Diagnostic + Send + Sync + 'static>
|
for Box<dyn Diagnostic + Send + Sync + 'static>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue