boolean toss = RemoteServiceProxy.isStatsAvailable()
&& RemoteServiceProxy.stats(RemoteServiceProxy.bytesStat(methodName,
requestId, encodedResponse.length(), "responseReceived"));
if (statusCode != Response.SC_OK) {
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");
} else if (RemoteServiceProxy.isReturnValue(encodedResponse)) {
result = (T) responseReader.read(streamFactory.createStreamReader(encodedResponse));