Ways to catch server side exception when using request factory?

44 views
Skip to first unread message

July

unread,
Sep 27, 2011, 10:17:07 AM9/27/11
to google-we...@googlegroups.com
hi all:
 I'm using RequestFactory to do B-S communication, usually the server throw an exception that i didn't catch, at the client side there will be an pop-up dialog indicating the server error, and from the exception stack, all are client side trace, and the message is "server error", so i have no way to know which method at server-side was throwing(there are more than one gwtrequest at one time), debugging this problem cost me much time, I was wondering if there a way to catch/show/debug server-side exception so i can get the problem immediately. 

Thanks in advance.

opn

unread,
Sep 27, 2011, 11:20:47 AM9/27/11
to google-we...@googlegroups.com
Hello,

the DefaultExceptionHandler is not doing much. As you can see it only sends the message over the wire.
I think you should hook in your own implementation of an ExceptionHandler.

My ExceptionHandler, for example, sends the exception class over to the client, too. I don't know how far you can go (sending the whole stacktrace or sth.).

To use it you also need to extend RequestFactoryServlet and pass your own ExceptionHandler implementation in the constructor.

public MyRequestFactoryServlet() {
        super(new MyExceptionHandler());
    }

and add this Servlet to your web.xml for sure!

Regards
Alex

July

unread,
Sep 27, 2011, 11:29:41 AM9/27/11
to google-we...@googlegroups.com
Quite helpful, Thanks very much for the reply.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/InnkUvczgLgJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Reply all
Reply to author
Forward
0 new messages