Added:
/trunk/modules/com.solertium.lwxml/src/com/solertium/lwxml/shared/utils/NativeDocumentErrorDecoder.java
=======================================
--- /dev/null
+++
/trunk/modules/com.solertium.lwxml/src/com/solertium/lwxml/shared/utils/NativeDocumentErrorDecoder.java
Tue Aug 3 11:29:19 2010
@@ -0,0 +1,20 @@
+package com.solertium.lwxml.shared.utils;
+
+import com.solertium.lwxml.shared.GWTResponseException;
+
+public class NativeDocumentErrorDecoder {
+
+ public static boolean isErrorCode(Throwable caught, int... code) {
+ if ((!(caught instanceof GWTResponseException)) || code.length == 0)
+ return false;
+
+ int errorCode = ((GWTResponseException)caught).getCode();
+
+ for (int current : code)
+ if (current == errorCode)
+ return true;
+
+ return false;
+ }
+
+}