Enhancement for issue 4870

Review at http://gwt-code-reviews.appspot.com/711802

Review by: zundel@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@8475 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/rpc/StatusCodeException.java b/user/src/com/google/gwt/user/client/rpc/StatusCodeException.java
index 058c6ca..e600118 100644
--- a/user/src/com/google/gwt/user/client/rpc/StatusCodeException.java
+++ b/user/src/com/google/gwt/user/client/rpc/StatusCodeException.java
@@ -23,16 +23,25 @@
  */
 public class StatusCodeException extends InvocationException {
   private final int statusCode;
+  private final String encodedResponse;
 
   /**
    * Construct an exception with the given status code and description.
    * 
    * @param statusCode the HTTP status code to report
-   * @param message a message to report
+   * @param encodedResponse the HTTP response message to report
    */
-  public StatusCodeException(int statusCode, String message) {
-    super(message);
+  public StatusCodeException(int statusCode, String encodedResponse) {
+    super(statusCode + " " + encodedResponse);
     this.statusCode = statusCode;
+    this.encodedResponse = encodedResponse;
+  }
+
+  /**
+   * Returns the response message associated with the failed request.
+   */
+  public String getEncodedResponse() {
+    return encodedResponse;
   }
 
   /**
@@ -41,5 +50,4 @@
   public int getStatusCode() {
     return statusCode;
   }
-}
-
+}
\ No newline at end of file