1 // Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
9 /** An exception which can be thrown and caught by JavaScript code */
10 public class JSExn extends Exception {
11 private Object js = null;
12 public JSExn(Object js) { this.js = js; }
13 public String toString() { return "JSExn: " + js; }
14 public String getMessage() { return toString(); }
15 public Object getObject() { return js; }
18 /** should only be used for failed coercions */
19 class JSRuntimeExn extends RuntimeException {
20 private Object js = null;
21 public JSRuntimeExn(Object js) { this.js = js; }
22 public String toString() { return "JSRuntimeExn: " + js; }
23 public String getMessage() { return toString(); }
24 public Object getObject() { return js; }