Include exception message in the printStackTrace() NbHtml4J
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 09 Jan 2014 17:22:41 +0100
branchNbHtml4J
changeset 1426d5d280615f60
parent 1425 43bb0053f3e2
child 1427 38f80da886d7
Include exception message in the printStackTrace()
rt/emul/mini/src/main/java/java/lang/Throwable.java
     1.1 --- a/rt/emul/mini/src/main/java/java/lang/Throwable.java	Thu Jan 09 16:38:15 2014 +0100
     1.2 +++ b/rt/emul/mini/src/main/java/java/lang/Throwable.java	Thu Jan 09 17:22:41 2014 +0100
     1.3 @@ -638,8 +638,11 @@
     1.4       *          ... 2 more
     1.5       * </pre>
     1.6       */
     1.7 -    @JavaScriptBody(args = {  }, body = "console.warn(this.toString());")
     1.8 -    public native void printStackTrace();
     1.9 +    public void printStackTrace() {
    1.10 +        warn(getClass().getName() + ": " + getMessage());
    1.11 +    }
    1.12 +    @JavaScriptBody(args = { "msg" }, body = "if (console) console.warn(msg.toString());")
    1.13 +    private native void warn(String msg);
    1.14  
    1.15      /**
    1.16       * Prints this throwable and its backtrace to the specified print stream.