It would be nice if RemoteServiceServlet had another hook:
protected void onUndeclaredException(Throwable caught) {
}
then in the processCall method:
// Serialize the exception back to the client if it's a
declared exception
if (isExpectedException(serviceIntfMethod, cause)) {
Class thrownClass = cause.getClass();
responsePayload = createResponse(streamWriter,
thrownClass, cause,
true);
// Don't log the exception on the server
caught = null;
} else {
// Notify subclass that an undeclared exception has been
thrown
onUndelaredException(caught);
}
-jason