1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00
denoland-deno/cli/tests/testdata/workers/error_event.ts
Nayeem Rahman 9853c96cc4
refactor: Remove PrettyJsError and js_error_create_fn (#14378)
This commit:
- removes "fmt_errors::PrettyJsError" in favor of "format_js_error" fn
- removes "deno_core::JsError::create" and 
"deno_core::RuntimeOptions::js_error_create_fn"
- adds new option to "deno_runtime::ops::worker_host::init"
2022-04-27 01:06:10 +02:00

11 lines
276 B
TypeScript

const worker = new Worker(new URL("error.ts", import.meta.url).href, {
type: "module",
});
worker.addEventListener("error", (e) => {
console.log({
"message": e.message,
"filename": e.filename?.slice?.(-100),
"lineno": e.lineno,
"colno": e.colno,
});
});