Exceptions in Event Handlers(inner classes) are not shown by Dev Mode Panel in Eclipse!

7 views
Skip to first unread message

J-Pro

unread,
Feb 4, 2010, 12:58:13 PM2/4/10
to Google Web Toolkit
Good afternoon, dear GWT group members!

I've noticed that if I create an event handler, for example

ButtonItem btnSubmit = new ButtonItem();
btnSubmit.addClickHandler(new
com.smartgwt.client.widgets.form.fields.events.ClickHandler()
{
@Override
public void
onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent
event)
{
int i = 5/0;
}
});

I can't see the problem in the Development Mode Panel in the Eclipse.
The last record there is "Module has been loaded". The application
itself behaves just as if nothing happened. You can try it by
yourself.

But if only I put "int i = 5/0;" after ButtonItem declaration, i.e.
not in inner class, the exception will be described in Development
Mode Panel.

Having this, it's very hard to catch errors... Can you advise anything
to me? Or is it a bug?


I use Eclipse 3.5 SR1, Google Plugin 1.2.0, GWT Toolkit SDK 2.0.1,
smartgwt 2.0, latest Firefox and Windows 7 x64 Ultimate.

Thank you very much in advance!

Joel Webber

unread,
Feb 5, 2010, 10:06:10 AM2/5/10
to google-we...@googlegroups.com
This may be a problem with SmartGWT. I'm not familiar with the details of how they deal with wrapping events from the native SmartClient widgets, but if they fail to properly punt exceptions to the UncaughtExceptionHandler, dev mode will eat the exceptions.


--
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-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.


Sanjiv Jivan

unread,
Feb 6, 2010, 7:03:51 PM2/6/10
to google-we...@googlegroups.com
J-Pro,
I've got some suggestions from John Tamplin on this and will be incorporating them in SmartGWT in a few days so this should be resolved soon. I see you've posted on the SmartGWT forum as well. I'll follow up with you on that thread.

Thanks,
Sanjiv

J-Pro

unread,
Feb 8, 2010, 3:44:04 PM2/8/10
to Google Web Toolkit
Thanks, Sanjiv Jivan, due to your post in SmartGWT forum, I'm now able
to see those exceptions!

For those who is interested in it too, here is Sanjiv's quote about
how to solve it:
----------------------
I've just checked in a bunch of code changes that incorporates proper
exception handling of uncaught exceptions. Please pick up the latest
build from SVN or nightly build (see FAQ sticky).

Note that while the change is backward compatible with GWT versions
lower than 2.0, you'll only be able to see the benefits of this
improved exception handling with GWT 2.0 and above.

If you want custom handling of uncaught exceptions you can register
your own UncaughtExceptionHandler with
GWT.setUncaughtExceptionHandler(..). Otherwise a default one is
already setup that displays the details of the error as an alert when
running in Dev Mode as well as the entire stack trace display in the
Dev. Console.

This is a significant improvement that I'm really happy about. Please
try out the latest build and let me know if you have any issues or are
seeing cases where exceptions are not captured.
----------------------

Thank you very much again, Sanjiv, you've helped a lot!


On Feb 7, 2:03 am, Sanjiv Jivan <sanjiv.ji...@gmail.com> wrote:
> J-Pro,
> I've got some suggestions from John Tamplin on this and will be
> incorporating them in SmartGWT in a few days so this should be resolved
> soon. I see you've posted on the SmartGWT forum as well. I'll follow up with
> you on that thread.
>
> Thanks,
> Sanjiv
>
> On Fri, Feb 5, 2010 at 10:06 AM, Joel Webber <j...@google.com> wrote:
> > This may be a problem with SmartGWT. I'm not familiar with the details of
> > how they deal with wrapping events from the native SmartClient widgets, but
> > if they fail to properly punt exceptions to the UncaughtExceptionHandler,
> > dev mode will eat the exceptions.
>

> >> google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsu...@googlegroups.com>


> >> .
> >> 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 google-we...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsu...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages