Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
5.15.10, 6.5.1
-
None
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
- is duplicated by
-
QTBUG-82637 Unhandled Promise Rejections in QJSEngine
-
- Reported
-