On Saturday, April 2, 2011 3:08:16 AM UTC+2, KaffeineComa wrote:
Hi Khiem, thanks for your reply.Are you saying that RequestFactoryServlet must be extended, and an ExceptionHandler must be installed somehow? If so, what exactly does the ExceptionHandler need to do?
Construct a ServerFailure from a given Throwable. You can then pass specific "tokens" that your client code will be able to analyze (if needed), but more importantly, you can tell whether the error should be considered "fatal" or not (default implementation of onFailure in Receiver throws a RuntimeException, but only if the ServerFailure is "fatal", which the DefaultExceptionHandler always produces)
My server code is already throwing exceptions; it's just that they're not getting propagated back to my client code.On the client I have code that does something like:requestContext.fire(newReceiver<T>() { public void onSuccess(T response) {// etc.}public void onFailure(ServerFailure error){// this never gets called}});
Assuming "requestContext" above actually is a Request (not a RequestContext), that's abnormal.
If you're indeed talking about a RequestContext (and your T should be read as Void), then it's the normal behavior: the RequestContext-level Receiver's onFailure will only be called if the server (more or less) failed to deserialize the request or serialize the response. When processing service method invocations, each service method's Receiver's onFailure can be called, independently of the others, and the RequestContext-level Receiver's onSuccess will be called in the end.
Have a look at the doFire method in AbstractRequestContext for the exact details of the client-side processing.
I appreciate your suggestion to search the group, but I have done so many times. Something is just broken with Google's new groups UI. I couldn't even find this thread to reply to you (I received your reply in an email); I had to back out of Google Groups and search with google.com, rather than Google Groups. It's really frustrating.
Just so you know: you're not alone!
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment