From b892188878fd5a1a38a45d1c2e892c41be240ca0 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 16 Jul 2018 23:25:50 -0400 Subject: Better exception output. --- js/runtime.ts | 2 +- js/util.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/runtime.ts b/js/runtime.ts index d234cdd85..c439fb963 100644 --- a/js/runtime.ts +++ b/js/runtime.ts @@ -36,7 +36,7 @@ window.onerror = ( // Error.prepareStackTrace handler. Users will get unmapped stack traces on // uncaught exceptions until this issue is fixed. //Error.prepareStackTrace = null; - console.log(error.message, error.stack); + console.log(error.stack); os.exit(1); }; diff --git a/js/util.ts b/js/util.ts index 7216f9491..05b243427 100644 --- a/js/util.ts +++ b/js/util.ts @@ -15,9 +15,9 @@ export function log(...args: any[]): void { } } -export function assert(cond: boolean, msg = "") { +export function assert(cond: boolean, msg = "assert") { if (!cond) { - throw Error(`Assert fail. ${msg}`); + throw Error(msg); } } -- cgit v1.2.3