diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2022-06-06 19:26:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-06 20:26:57 +0200 |
commit | e3eae662f3d753141571bd132ccb199f95c745ea (patch) | |
tree | e0cdad78f409c9b221b909d0d7dfcee286e6325f /core/runtime.rs | |
parent | 1081659be176a59512a7e9e3dc93e13046a26aec (diff) |
fix: Format non-error exceptions (#14604)
This commit adds "Deno.core.setFormatExceptionCallback" which
can be used to provide custom formatting for errors. It is useful
in cases when user throws something that is non-Error (eg.
a string, plain object, etc).
Diffstat (limited to 'core/runtime.rs')
-rw-r--r-- | core/runtime.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/runtime.rs b/core/runtime.rs index 3578b216a..66d28226e 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -152,6 +152,7 @@ pub(crate) struct JsRuntimeState { pub(crate) js_nexttick_cbs: Vec<v8::Global<v8::Function>>, pub(crate) js_promise_reject_cb: Option<v8::Global<v8::Function>>, pub(crate) js_uncaught_exception_cb: Option<v8::Global<v8::Function>>, + pub(crate) js_format_exception_cb: Option<v8::Global<v8::Function>>, pub(crate) has_tick_scheduled: bool, pub(crate) js_wasm_streaming_cb: Option<v8::Global<v8::Function>>, pub(crate) pending_promise_exceptions: @@ -386,6 +387,7 @@ impl JsRuntime { js_nexttick_cbs: vec![], js_promise_reject_cb: None, js_uncaught_exception_cb: None, + js_format_exception_cb: None, has_tick_scheduled: false, js_wasm_streaming_cb: None, source_map_getter: options.source_map_getter, |