summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/main.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/js/main.ts b/js/main.ts
index 265037111..826d3e811 100644
--- a/js/main.ts
+++ b/js/main.ts
@@ -25,9 +25,13 @@ function onGlobalError(
source: string,
lineno: number,
colno: number,
- error: Error
+ error: any // tslint:disable-line:no-any
) {
- console.log(error.stack);
+ if (error instanceof Error) {
+ console.log(error.stack);
+ } else {
+ console.log(`Thrown: ${String(error)}`);
+ }
os.exit(1);
}