summaryrefslogtreecommitdiff
path: root/runtime/worker.rs
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r--runtime/worker.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs
index 97ea53980..2fb32c766 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -566,11 +566,16 @@ impl MainWorker {
}
let scope = &mut self.js_runtime.handle_scope();
+ let scope = &mut v8::TryCatch::new(scope);
let args = options.as_v8(scope);
let bootstrap_fn = self.bootstrap_fn_global.take().unwrap();
let bootstrap_fn = v8::Local::new(scope, bootstrap_fn);
let undefined = v8::undefined(scope);
- bootstrap_fn.call(scope, undefined.into(), &[args]).unwrap();
+ bootstrap_fn.call(scope, undefined.into(), &[args]);
+ if let Some(exception) = scope.exception() {
+ let error = JsError::from_v8_exception(scope, exception);
+ panic!("Bootstrap exception: {error}");
+ }
}
/// See [JsRuntime::execute_script](deno_core::JsRuntime::execute_script)