Skip to content

Commit

Permalink
fix: add source() to JsErrorBox
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jan 6, 2025
1 parent 97b1c2f commit 3b4f6b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,11 @@ impl std::fmt::Display for JsErrorBox {
}
}

impl std::error::Error for JsErrorBox {}
impl std::error::Error for JsErrorBox {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
self.inner.as_ref().and_then(|e| e.source())
}
}

impl JsErrorClass for JsErrorBox {
fn get_class(&self) -> &'static str {
Expand Down

0 comments on commit 3b4f6b6

Please sign in to comment.