Skip to content

Commit

Permalink
Work around panic in Deno ops
Browse files Browse the repository at this point in the history
  • Loading branch information
mlafeldt committed May 11, 2024
1 parent c106dd1 commit 8603c5e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ pub fn to_v8_error<'a>(
let e = tc_scope.exception().unwrap();
let js_error = JsError::from_v8_exception(tc_scope, e);
msg = format!("{}: {}", msg, js_error.exception_message);

// XXX: Prevent panic "Custom error class must have a builder registered: Uncaught null"
// from taking down the whole process. Return the underlying error message instead.
if js_error.exception_message == "Uncaught null" {
println!("to_v8_error: {msg}");
return message.into();
}
}
panic!("{}", msg);
}
Expand Down

0 comments on commit 8603c5e

Please sign in to comment.