Skip to content
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

Exception: UnhandledRejection: Non-Error promise rejection captured with value: Timeout #5833

Closed
3 tasks done
ElenVlass opened this issue Sep 27, 2022 · 3 comments
Closed
3 tasks done

Comments

@ElenVlass
Copy link

ElenVlass commented Sep 27, 2022

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/gatsby

SDK Version

6.15.0

Framework Version

Gatsby 2.32.3

Link to Sentry event

https://sentry.io/organizations/brocoders-z0/issues/2830974094/?project=5395466&query=is%3Aunresolved

Steps to Reproduce

In my app, I’ve received thousands (almost 5K for a month) of

UnhandledRejection: Non-Error promise rejection captured with value: Timeout

.
I’ve searched through our code and all compiled third-party code, looking for Timeout. This string isn’t thrown or passed to reject() anywhere. It’s pretty difficult to narrow down the root of the problem as there’s virtually no information about the script that is causing it. I suggest that this is coming from a third-part lib that loaded at runtime. Console points to this function in recaptch_en_gb.js:
"function" === typeof window[D] ? Promise.resolve().then(window[D]) : "function" === typeof D ? Promise.resolve().then(D) : D && console.log("reCAPTCHA couldn't find user-provided function: " + D)
It looks like the same issue as 2514 that has been closed.

Expected Result

I'm suggesting to add some custom code to @sentry/gatsby (if there isn't already) for handling this special case with non-Error types properly.

Actual Result

Screenshot 2022-09-27 at 14 47 43

Screenshot 2022-09-27 at 14 46 31

@lforst
Copy link
Member

lforst commented Sep 27, 2022

Hi, thanks for writing in! As a rule of thumb, we generally don't add code in the SDKs to handle specific errors of third parties. (There are some exceptions to this when we notice the impact is high enough - which in this case I don't believe it is)

What we recommend in this case is filtering your events via SDK configuration: https://docs.sentry.io/platforms/javascript/configuration/filtering/

Here, my specific recommend would be for you to use the ignoreErrors option or configuring the beforeSend option to drop these events, by looking at the error name and returning null if it matches the error you're describing.

@github-actions
Copy link
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@github-actions
Copy link
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants