Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INTERNAL][FIX] ui5loader: avoid 'Uncaught (in promise)' log entries
To support a mixture of sync and async module loading, the ui5loader creates a Promise for any requested resource to track its loading state, even when the first requestor uses a synchronous API. As long as no asynchronous API asks for the same resource, this promise is never used. Modern browsers report a rejection of such a promise as 'Uncaught (in promise)' error and report it on the console. One solution would be to create the Promise only on demand, but then error tracking would be more complicated. As an alternative, this change adds a dummy catch handler to the promise. This has no impact on error reporting via APIs (errback - covered by tests). For some background, see the discussion about rejected promises ( nodejs/node#830 ) and the current answer of the HTML5 spec to the topic ( https://html.spec.whatwg.org/multipage/webappapis.html#unhandled-promise-rejections ) Change-Id: I99e5c1384a4e5caf7ccdf21db1dfadbdc75884f3
- Loading branch information