aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-09 14:31:55 -0400
committerAlon Zakai <alonzakai@gmail.com>2013-10-09 14:31:55 -0400
commit0d989261dc74e81c317f4f4114c285cb57c1a01a (patch)
treebc8b0088a2c328e51b12f38b111bc4855a2cc7fc
parent028a3210fc61df40fae2854be6ad8b65e49ba633 (diff)
print call stack of errors, when there is one
-rw-r--r--src/library_browser.js1
-rw-r--r--src/postamble.js1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/library_browser.js b/src/library_browser.js
index cba8ecdf..dd60a581 100644
--- a/src/library_browser.js
+++ b/src/library_browser.js
@@ -749,6 +749,7 @@ mergeInto(LibraryManager.library, {
if (e instanceof ExitStatus) {
return;
} else {
+ if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);
throw e;
}
}
diff --git a/src/postamble.js b/src/postamble.js
index cd892733..62edeeb6 100644
--- a/src/postamble.js
+++ b/src/postamble.js
@@ -96,6 +96,7 @@ Module['callMain'] = Module.callMain = function callMain(args) {
Module['noExitRuntime'] = true;
return;
} else {
+ if (e && typeof e === 'object' && e.stack) Module.printErr('exception thrown: ' + [e, e.stack]);
throw e;
}
} finally {