diff --git a/src/protocol.rs b/src/protocol.rs index 2a6545a..2493346 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -59,6 +59,11 @@ pub trait Diagnostic: std::error::Error { fn related<'a>(&'a self) -> Option + 'a>> { None } + + /// The cause of the error. + fn caused_by(&self) -> Option<&dyn Diagnostic> { + None + } } impl std::error::Error for Box {