Identify bad responses coming back from the server, and throw a specific exception...
[frank.git] / prod / net / jaekl / qd / http / InvalidResponseException.java
diff --git a/prod/net/jaekl/qd/http/InvalidResponseException.java b/prod/net/jaekl/qd/http/InvalidResponseException.java
new file mode 100644 (file)
index 0000000..525772e
--- /dev/null
@@ -0,0 +1,25 @@
+package net.jaekl.qd.http;
+
+import net.jaekl.qd.QDException;
+
+public class InvalidResponseException extends QDException {
+       private static final long serialVersionUID = 1L;
+
+       String m_url;
+       String m_method;
+       
+       public InvalidResponseException(String url, String method, Throwable cause) {
+               super(cause);
+               
+               m_url = url;
+               m_method = method;
+       }
+       
+       public String getUrl() { return m_url; }
+       public String getMethod() { return m_method; }
+       
+       @Override
+       public String toString() {
+               return getClass().getName() + "; " + m_url + "/" + m_method; 
+       }
+}