Add ability to see raw response from server when something goes wrong. (OC Transpo...
[frank.git] / prod / net / jaekl / qd / http / InvalidResponseException.java
index 525772e4627789dc2e72b4c650c20f1e8f180419..7d0bdc85d8a21c5bff5c9877d7f9b820883fb874 100644 (file)
@@ -7,12 +7,14 @@ public class InvalidResponseException extends QDException {
 
        String m_url;
        String m_method;
+       String m_response;      // first few bytes of the actual response
        
-       public InvalidResponseException(String url, String method, Throwable cause) {
+       public InvalidResponseException(Throwable cause, String url, String method, String response) {
                super(cause);
                
                m_url = url;
                m_method = method;
+               m_response = response;
        }
        
        public String getUrl() { return m_url; }
@@ -20,6 +22,6 @@ public class InvalidResponseException extends QDException {
        
        @Override
        public String toString() {
-               return getClass().getName() + "; " + m_url + "/" + m_method; 
+               return getClass().getName() + "; " + m_url + "/" + m_method + "=>\"" + m_response + "\""
        }
 }