-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhandled Promise error detected when using the manual session.setup function #2358
Comments
Hello @swelham, can you make sure that Could you try debugging what is causing the rejection? If I'm not mistaken, when ESA fails to setup itself / restore authentication it doesn't raise an error. Are there any requests failing when it occurs? |
Hey @BobrImperator, I believe I have the
I have spent some more time debugging and I have been able to capture the error coming from the Unfortunately, our error tracking sdk (sentry) still catches the caught error and reports it. I can configure sentry to ignore the error, but as it's just a generic I am wondering if there is a way for the |
The |
Thanks, I have dug a bit deeper and found that when the promise fails, the error is still raised in the browser but as a caught exception. After some experimenting, I worked out that using a For example, changing the restore part of the session setup function to something like this prevents the error from being raised. await this.session.restore().catch(() => {
// Ignore errors when restoring the session
}); Would this be an acceptable change? |
I think that's correct. Though I'm not exactly sure how sentry manages to get this error even though it's already caught and hushed out internally by ESA. |
Yeah, I believe sentry is doing something lower level as I think it's more of a generic js SDK than ember specific. I also don't see the error in the console unless I enable break on all exceptions including caught exceptions. |
@swelham Could you let me know what version of sentry you're using and which package? |
Sure, we're using After some more debugging I noticed in the I tried the code, specifying a hard-coded error reason with the I feel like there is a subtle difference in how these two error handling approaches are working with the promise rejection and it only becomes clear when using an error reason. |
@BobrImperator is there anything I can do to further assist on this issue? |
It's possible for an `UnhandledPromiseError` to raise in the background when restoring the session. This doesn't raise to the caller of the library but does occur as a caught exception in the browser, which in turn can be picked up by error tracking code such as sentry. This fixes mainmatter#2358 which has more specific detail around the issue and how to reproduce it.
It's possible for an `UnhandledPromiseError` to raise when restoring the session. This doesn't raise to the caller of the library but does occur as a caught exception in the browser, which in turn can be picked up by error tracking code such as sentry. This fixes mainmatter#2358 which has more specific detail around the issue and how to reproduce it.
It's possible for an `UnhandledPromiseError` to raise when restoring the session. This doesn't raise to the caller of the library but does occur as a caught exception in the browser, which in turn can be picked up by error tracking code such as sentry. This fixes mainmatter#2358 which has more specific detail around the issue and how to reproduce it.
It's possible for an `UnhandledPromiseError` to raise when restoring the session. This doesn't raise to the caller of the library but does occur as a caught exception in the browser, which in turn can be picked up by error tracking code such as sentry. This fixes #2358 which has more specific detail around the issue and how to reproduce it.
We recently upgraded to v4 of ESA and noticed a deprecation warning. After searching through the repo I found the v4 upgrade guides and applied the changes suggested. When we rolled this out to production we immediately started getting
Unhandled Promise error detected
errors coming in on every page load.I have verified this was due to the upgrade by redeploying with and without the
this.session.setup();
call. From this, I can see the error is only produced when a call tosetup
is present. I have tried the two following approaches in our application routebeforeModel
function and both cases have resulted in the same error.and
Our ember version is 3.24.0 and ESA version is 4.1.1.
The text was updated successfully, but these errors were encountered: