From cf1be5e76fc8d62357f1f4a51e610bd4f07a7927 Mon Sep 17 00:00:00 2001 From: Cre3per <12541974+Cre3per@users.noreply.github.com> Date: Sun, 16 Oct 2022 21:16:46 +0200 Subject: fix: add error cause in recursive cause tail (#16306) --- core/error.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/error.rs') diff --git a/core/error.rs b/core/error.rs index 7af6ad375..626f9b6f2 100644 --- a/core/error.rs +++ b/core/error.rs @@ -209,7 +209,7 @@ impl JsError { fn inner_from_v8_exception<'a>( scope: &'a mut v8::HandleScope, exception: v8::Local<'a, v8::Value>, - mut seen: HashSet>, + mut seen: HashSet>, ) -> Self { // Create a new HandleScope because we're creating a lot of new local // handles below. @@ -254,10 +254,10 @@ impl JsError { } }); let cause = cause.and_then(|cause| { - if cause.is_undefined() || seen.contains(&cause) { + if cause.is_undefined() || seen.contains(&exception) { None } else { - seen.insert(cause); + seen.insert(exception); Some(Box::new(JsError::inner_from_v8_exception( scope, cause, seen, ))) -- cgit v1.2.3