Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

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

    Good afternoon, dear Smart GWT gurus!

    I've asked my question in GWT group, but people there think that it's smartgwt module problem, so I repeat it here.

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

    Code:
    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!

    #2
    Does anything show up in the SmartGWT developer console?

    Though more than once I've encountered some exceptions that just disappear. Either the GUI doesn't load or something elements don't do anything, but no exceptions are thrown.

    Comment


      #3
      I responded to your post on the GWT forum. For the benefit of others :

      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.

      Comment


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

        Thanks,
        Sanjiv

        Comment


          #5
          Thanks Sanjiv! Hopefully this will eliminate many quirks when testing!

          (ot: I found this to be a problem in GWT-Ext as well, especially GUI related code, sometimes things just wouldn't happen and it would require single stepping to find the culprit because no exceptions are thrown)

          Comment


            #6
            Originally posted by sunnyl
            Does anything show up in the SmartGWT developer console?
            No, that's what I'm talking about.

            Originally posted by sjivan
            ...
            code changes that incorporates proper exception handling of uncaught exceptions
            ...
            Sounds cool, thanks for the info!

            Originally posted by sjivan
            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.
            I hope it's already described in FAQ? People must know about it...

            Originally posted by sjivan
            ...
            Please try out
            ...
            Tried out, it seems that it works! It gives msg window and also prints out in the dev console!

            Thank you very much for your help! I'll post your quote in GWT forum if you don't mind :)

            Comment


              #7
              $entry not defined

              Hello. I'm running this new code from a trunk build with GWT 1.7.0 and I'm getting the exception "$entry not defined" on this line:

              Code:
              function xgc(){
                 if(!$entry){      // <--- error here
                    $entry=function(b,c,a){return b.apply(c,a)}}
                    if($wnd.isc.Br. . .
              Which appears to be part of the new unhandled exception handling mod.
              Is there some change I need to make to my application. I cannot (yet) upgrade to GWT 2.0.

              Should this perhaps be
              Code:
                   if(! self['$entry']) {
              Thanks.

              Comment


                #8
                We'll look into it.

                Comment


                  #9
                  Is there also a smartgwtee-eval build available with these fixes?

                  Thanks in advance,
                  David

                  Comment


                    #10
                    Originally posted by sjivan
                    let me know if you have any issues or are seeing cases where exceptions are not captured.
                    This is not captured:

                    http://forums.smartclient.com/showthread.php?t=9579

                    Comment


                      #11
                      @csillag You're pointing to a JavaScript error reported in the Developer Console. That's already correct behavior - this thread is about GWT generating exceptions which it does not report.

                      Comment


                        #12
                        Originally posted by ddabbs
                        Hello. I'm running this new code from a trunk build with GWT 1.7.0 and I'm getting the exception "$entry not defined" on this line:

                        Code:
                        function xgc(){
                           if(!$entry){      // <--- error here
                              $entry=function(b,c,a){return b.apply(c,a)}}
                              if($wnd.isc.Br. . .
                        Which appears to be part of the new unhandled exception handling mod.
                        Is there some change I need to make to my application. I cannot (yet) upgrade to GWT 2.0.

                        Should this perhaps be
                        Code:
                             if(! self['$entry']) {
                        Thanks.
                        ddabbs,
                        This should be fixed in SVN. Please try with the latest build and confirm that things work with GWT 1.7.

                        Thanks,
                        Sanjiv

                        Comment

                        Working...
                        X