If there is error in async function UXP won’t tell you it. Also I want to integrate Sentry.
I can add Sentry for Browser. I can also explicitly send an error calling sentry function and it works. But it does not catch unhadled rejections automatically. Because onunhandledrejection
is not implemented in UXP.
Sentry listents to that event but UXP will never fire it. Also unhandled rejection is never logged into console by default. I have to use try/catch and rethrow it myslef.
Is there some a way to workaround it? I was thinking maybe to intercept Error constructor or something like that but it did not work. And Error.captureStackTrace
is called in so many non-error cases that I cannot use it.
I can wrap top level code into try/catch call Sentry explicitly and it works for awaited child functions but if some nested promise is not awaited then it is not catched and error not reported.