mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-25 17:45:36 +00:00
Better stack trace reporting in objj
This commit is contained in:
1 parent
86cc38cd69
commit
9ef4a92613
1 file changed
+21
@@ -74,6 +74,27 @@ catch (e)
|
||||
if (e.rhinoException)
|
||||
{
|
||||
print(" Rhino Exception: " + e.rhinoException);
|
||||
|
||||
print(" *** Message: " + e.rhinoException.getMessage());
|
||||
print(" *** Source name: " + e.rhinoException.sourceName());
|
||||
print(" *** Line number: " + e.rhinoException.lineNumber());
|
||||
print(" *** Column number: " + e.rhinoException.columnNumber());
|
||||
print(" *** Line Source: " + e.rhinoException.lineSource());
|
||||
|
||||
// print the JavaScript stack trace with line numbers:
|
||||
print(" *** Filtered stack trace:");
|
||||
var bos = new Packages.java.io.ByteArrayOutputStream();
|
||||
e.rhinoException.printStackTrace(new Packages.java.io.PrintStream(bos));
|
||||
var stack = String(bos.toString()).split("\n").slice(1);
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
var match;
|
||||
if (match = stack[i].match(/_c[0-9]+\((.+)\)/))
|
||||
print(match[1]);
|
||||
}
|
||||
|
||||
print(" *** Script stack trace:\n" + e.rhinoException.getScriptStackTrace());
|
||||
|
||||
print(" *** Raw stack trace:");
|
||||
e.rhinoException.printStackTrace();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user