2003/04/24 10:25:09
[org.ibex.core.git] / src / org / xwt / Proxy.java
index 15e6ef0..632034e 100644 (file)
@@ -125,6 +125,14 @@ public class Proxy {
                 Log.log(Platform.class, "WPAD detection failed due to:");
                 if (e instanceof EcmaError) Log.log(HTTP.class, ((EcmaError)e).getMessage() + " at " +
                                                     ((EcmaError)e).getSourceName() + ":" + ((EcmaError)e).getLineNumber());
+                else if (e instanceof JavaScriptException) {
+            try {
+            XWT.recursivePrintObject.call(Context.enter(), null, null, new Object[] {
+                ((JavaScriptException)e).getValue() });
+            } catch (Exception e2) {
+            Log.log(Platform.class, e);
+            }
+        }
                 else Log.log(Platform.class, e);
             }
             return null;
@@ -279,10 +287,10 @@ public class Proxy {
             };
         
         private static boolean match(String[] arr, String s, int index) {
-            if (index == arr.length) return true;
+            if (index >= arr.length) return true;
             for(int i=0; i<s.length(); i++) {
                 String s2 = s.substring(i);
-                if (s2.startsWith(arr[index]) && match(arr, s.substring(arr[index].length()), index + 1)) return true;
+                if (s2.startsWith(arr[index]) && match(arr, s2.substring(arr[index].length()), index + 1)) return true;
             }
             return false;
         }