From 3b4f6b6adae60ce0388b44e0bd6e2bec1ea0e889 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 6 Jan 2025 16:30:09 -0500 Subject: [PATCH] fix: add source() to JsErrorBox --- src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 1b78bcc..a209116 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 {