Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-118033

Exception throw from promise executor / handlers and not handled by user are just silented

    XMLWordPrintable

Details

    • Linux/X11, macOS, Windows

    Description

      Having an error (typerror, referenceerror, etc.) or throwing an exception in a JS promise executor (callback passed to the promise constructor) or in one of its handlers (promise.then) just stop the execution of the executor / handler without printing anything if we don't catch it manually which make it very difficult to debug.

       

      For instance in Node.js this case is handled by automatically printing the error resulting of an unhandled exception originating from inside a promise. In standard web client, it is possible to define an event handler for such a case (see https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event) to automatically grab the exception and do whatever you want with it, e.g print it !

       

      It would be great if we could add our own handler for such a case or at least if the default one could automatically print uncaught exception as in Node.js.

       

      The attachment is an example demonstrating this and can be launched directly with the "qml" executable.

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qtqmlteam Qt Qml Team User
              oxyde Olivier CARRE
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes