Add the method name to the message of InvocationService to make it easier to
find out the rootcause of the exception.
Review at http://gwt-code-reviews.appspot.com/1450803
Review by: rjrjr@google.com
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10207 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/rpc/client/impl/RpcCallbackAdapter.java b/user/src/com/google/gwt/rpc/client/impl/RpcCallbackAdapter.java
index 5bb5998..d147178 100644
--- a/user/src/com/google/gwt/rpc/client/impl/RpcCallbackAdapter.java
+++ b/user/src/com/google/gwt/rpc/client/impl/RpcCallbackAdapter.java
@@ -83,7 +83,7 @@
caught = new StatusCodeException(statusCode, encodedResponse);
} else if (encodedResponse == null) {
// This can happen if the XHR is interrupted by the server dying
- caught = new InvocationException("No response payload");
+ caught = new InvocationException("No response payload from " + methodName);
} else {
result = (T) streamFactory.createStreamReader(encodedResponse).readObject();
}
diff --git a/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java b/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java
index 1ccdcc4..d2efbfc 100644
--- a/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java
+++ b/user/src/com/google/gwt/user/client/rpc/impl/RemoteServiceProxy.java
@@ -372,7 +372,8 @@
return rb.send();
} catch (RequestException ex) {
InvocationException iex = new InvocationException(
- "Unable to initiate the asynchronous service invocation -- check the network connection",
+ "Unable to initiate the asynchronous service invocation (" +
+ methodName + ") -- check the network connection",
ex);
callback.onFailure(iex);
} finally {
diff --git a/user/src/com/google/gwt/user/client/rpc/impl/RequestCallbackAdapter.java b/user/src/com/google/gwt/user/client/rpc/impl/RequestCallbackAdapter.java
index d6c3cbf..6e75a04 100644
--- a/user/src/com/google/gwt/user/client/rpc/impl/RequestCallbackAdapter.java
+++ b/user/src/com/google/gwt/user/client/rpc/impl/RequestCallbackAdapter.java
@@ -209,13 +209,13 @@
caught = new StatusCodeException(statusCode, encodedResponse);
} else if (encodedResponse == null) {
// This can happen if the XHR is interrupted by the server dying
- caught = new InvocationException("No response payload");
+ caught = new InvocationException("No response payload from " + methodName);
} else if (RemoteServiceProxy.isReturnValue(encodedResponse)) {
result = (T) responseReader.read(streamFactory.createStreamReader(encodedResponse));
} else if (RemoteServiceProxy.isThrownException(encodedResponse)) {
caught = (Throwable) streamFactory.createStreamReader(encodedResponse).readObject();
} else {
- caught = new InvocationException(encodedResponse);
+ caught = new InvocationException(encodedResponse + " from " + methodName);
}
} catch (com.google.gwt.user.client.rpc.SerializationException e) {
caught = new IncompatibleRemoteServiceException(