Loading ...
Sorry, an error occurred while loading the content.

force exceptions to bubble?

Expand Messages
  • kingbenny99
    how do I make exceptions bubble up into top level (e.g. I d like to see it in firebug) ? In the below snippet, the alert works fine, but then an exception
    Message 1 of 5 , Oct 8, 2007
    • 0 Attachment
      how do I make exceptions bubble up into top level (e.g. I'd like to
      see it in firebug) ? In the below snippet, the alert works fine, but
      then an exception occurs on the next line. However, I can't see the
      exception anywhere. Any ideas?
      Thanks,
      Ben Anderson

      <html>
      <head>
      <script
      src="http://yui.yahooapis.com/2.3.1/build/yahoo/yahoo-min.js" ></script>
      <script
      src="http://yui.yahooapis.com/2.3.1/build/event/event-min.js" ></script>
      <script type="text/javascript">
      function myInit() {
      alert('hello');
      function_does_not_exist();
      }
      YAHOO.util.Event.onDOMReady(myInit);
      </script>
      </head>
      <body>
      </body>
      </html>
    • Adam Moore
      ... The alert will pause the execution of your script. This error will not occur until after the alert box is closed. -Adam
      Message 2 of 5 , Oct 8, 2007
      • 0 Attachment
        On Mon, Oct 08, 2007 at 07:30:55PM -0000, kingbenny99 wrote:
        > how do I make exceptions bubble up into top level (e.g. I'd like to
        > see it in firebug) ? In the below snippet, the alert works fine, but
        > then an exception occurs on the next line. However, I can't see the
        > exception anywhere. Any ideas?
        > Thanks,
        > Ben Anderson
        >
        > <html>
        > <head>
        > <script
        > src="http://yui.yahooapis.com/2.3.1/build/yahoo/yahoo-min.js" ></script>
        > <script
        > src="http://yui.yahooapis.com/2.3.1/build/event/event-min.js" ></script>
        > <script type="text/javascript">
        > function myInit() {
        > alert('hello');
        > function_does_not_exist();

        The alert will pause the execution of your script. This error will not
        occur until after the alert box is closed.


        -Adam
      • kingbenny99
        yes, I realize that. I guess I just put the alert in to show that the script is being executed. It makes it hard for me as a developer to not be able to see
        Message 3 of 5 , Oct 9, 2007
        • 0 Attachment
          yes, I realize that. I guess I just put the alert in to show that the
          script is being executed. It makes it hard for me as a developer to
          not be able to see that an exception happened. My question is how do
          I force yui's event handling code not to swallow up exceptions being
          thrown in my code. I guess I can add the logging module, but that's
          pretty weak compared with firebug.

          --- In ydn-javascript@yahoogroups.com, Adam Moore <adamoore@...> wrote:
          >
          > On Mon, Oct 08, 2007 at 07:30:55PM -0000, kingbenny99 wrote:
          > > how do I make exceptions bubble up into top level (e.g. I'd like to
          > > see it in firebug) ? In the below snippet, the alert works fine, but
          > > then an exception occurs on the next line. However, I can't see the
          > > exception anywhere. Any ideas?
          > > Thanks,
          > > Ben Anderson
          > >
          > > <html>
          > > <head>
          > > <script
          > > src="http://yui.yahooapis.com/2.3.1/build/yahoo/yahoo-min.js"
          ></script>
          > > <script
          > > src="http://yui.yahooapis.com/2.3.1/build/event/event-min.js"
          ></script>
          > > <script type="text/javascript">
          > > function myInit() {
          > > alert('hello');
          > > function_does_not_exist();
          >
          > The alert will pause the execution of your script. This error will not
          > occur until after the alert box is closed.
          >
          >
          > -Adam
          >
        • Adam Moore
          ... The reason I thought the alert was the problem was because YUI does not normally swallow exceptions. Based upon your comment I can only guess that you
          Message 4 of 5 , Oct 9, 2007
          • 0 Attachment
            On Tue, Oct 09, 2007 at 12:27:14PM -0000, kingbenny99 wrote:
            > yes, I realize that. I guess I just put the alert in to show that the
            > script is being executed. It makes it hard for me as a developer to
            > not be able to see that an exception happened. My question is how do
            > I force yui's event handling code not to swallow up exceptions being
            > thrown in my code. I guess I can add the logging module, but that's
            > pretty weak compared with firebug.

            The reason I thought the alert was the problem was because YUI does not
            normally swallow exceptions. Based upon your comment I can only guess
            that you have the logger module included in the page but are not using
            it. In this case, exceptions would be swallowed. This is a bug in
            the library. If this is your problem, the fix is to remove the logger
            or use it (in which case the exceptions are logged).

            -Adam
          • kingbenny99
            aha - I guess I was in some middleground area. I removed the logger module and now I ve got what I want. Thanks much!
            Message 5 of 5 , Oct 9, 2007
            • 0 Attachment
              aha - I guess I was in some middleground area. I removed the logger
              module and now I've got what I want. Thanks much!

              --- In ydn-javascript@yahoogroups.com, Adam Moore <adamoore@...> wrote:
              >
              > On Tue, Oct 09, 2007 at 12:27:14PM -0000, kingbenny99 wrote:
              > > yes, I realize that. I guess I just put the alert in to show that the
              > > script is being executed. It makes it hard for me as a developer to
              > > not be able to see that an exception happened. My question is how do
              > > I force yui's event handling code not to swallow up exceptions being
              > > thrown in my code. I guess I can add the logging module, but that's
              > > pretty weak compared with firebug.
              >
              > The reason I thought the alert was the problem was because YUI does not
              > normally swallow exceptions. Based upon your comment I can only guess
              > that you have the logger module included in the page but are not using
              > it. In this case, exceptions would be swallowed. This is a bug in
              > the library. If this is your problem, the fix is to remove the logger
              > or use it (in which case the exceptions are logged).
              >
              > -Adam
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.