u can extends requestfactoryservlet to use your exceptionhandler (which creates ServerFailure), (dont forget to put it in web.xml instead of the default requestfactoryservlet) when u throw exception on server, onFailure will be called, not exactly Exception/Throwable thou.
there's a post about it in this forum already, just try to search. On Fri, Apr 1, 2011 at 5:45 AM, KaffeineComa <[email protected]> wrote: > Like the asker of this question: > > > http://stackoverflow.com/questions/5277084/handling-gwt-requestfactory-server-error-responses > > I'd like to be able to return errors to the front-end > when RequestFactoryServlet encounters a problem. Thrown exceptions never > seem to result in onFailure() or onViolation() being called. Instead, > onSuccess() is called despite the failure. > > I also tried > setting res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR), but > that just results in java.lang.IllegalStateException, presumably because > super.doPost() has already written to the response. (You might wonder why > I'm running code after super.doPost()- it's because I'm committing and > closing my EntityManager.) > > What must I do to propagate errors to the front-end? Is there some > Exception subclass I should throw? > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
