2003/11/29 03:06:10
[org.ibex.core.git] / src / org / xwt / js / JSExn.java
index 370da2d..2cc9591 100644 (file)
@@ -7,10 +7,20 @@ import java.io.*;
 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; } 
+}
+