import java.util.*;
/** An exception which can be thrown and caught by JavaScript code */
-public class JSExn extends RuntimeException {
+public class JSExn extends Exception {
private Object js = null;
public JSExn(Object js) { this.js = js; }
public String toString() { return "JSExn: " + js; }
public String getMessage() { return toString(); }
public Object getObject() { return js; }
}
+
+/** should only be used for failed coercions */
+class JSRuntimeExn extends RuntimeException {
+ private Object js = null;
+ public JSRuntimeExn(Object js) { this.js = js; }
+ public String toString() { return "JSRuntimeExn: " + js; }
+ public String getMessage() { return toString(); }
+ public Object getObject() { return js; }
+}
+