mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 21:50:00 -05:00
Add onerror handler for uncaught exceptions
This commit is contained in:
parent
fe6e4febdb
commit
65a2c4b421
1 changed files with 6 additions and 0 deletions
|
@ -23,6 +23,12 @@ const deno = { pub, sub };
|
||||||
type AmdFactory = (...args: any[]) => undefined | object;
|
type AmdFactory = (...args: any[]) => undefined | object;
|
||||||
type AmdDefine = (deps: string[], factory: AmdFactory) => void;
|
type AmdDefine = (deps: string[], factory: AmdFactory) => void;
|
||||||
|
|
||||||
|
// Uncaught exceptions are sent to window.onerror by v8worker2.
|
||||||
|
window.onerror = function(message, source, lineno, colno, error) {
|
||||||
|
console.log(error.message, error.stack);
|
||||||
|
os.exit(1);
|
||||||
|
};
|
||||||
|
|
||||||
export function setup(mainJs: string, mainMap: string): void {
|
export function setup(mainJs: string, mainMap: string): void {
|
||||||
sourceMaps.install({
|
sourceMaps.install({
|
||||||
installPrepareStackTrace: true,
|
installPrepareStackTrace: true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue