Repository navigation
Commit 47ac957
committed
[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: I99e5c1384a4e5caf7ccdf21db1dfadbdc75884f31 parent b16f185 commit 47ac957
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
| 702 | + | |
| 703 | + | |
702 | 704 | | |
703 | 705 | | |
704 | 706 | | |
| |||
0 commit comments