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

fix(core): Stop rejecting in flush and close when client undefined #3846

Merged
merged 2 commits into from
Jul 28, 2021

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Jul 27, 2021

Currently, if the SDK has no client defined, calling Sentry.close() or Sentry.flush() will result in a promise rejection. Since this is not an error per se, this PR changes that rejection to a logged warning and a promise resolution with false. It also fleshes out the docstrings on all of the downstream methods (all of which essentially do the same thing - wait for the event queue to be empty, or timeout if it takes too long).

Fixes #3031
Fixes #3746

@lobsterkatie
Copy link
Member Author

lobsterkatie commented Jul 27, 2021

@kamilogorek - I realized after the fact that in the linked issue you'd suggested logger.error rather than logger.warn. Do you feel strongly about the level? I can go back and change it if so.

@lobsterkatie lobsterkatie force-pushed the kmclb-no-rejecting-with-false branch from 624f980 to 0d1e647 Compare July 27, 2021 22:41
@github-actions
Copy link
Contributor

github-actions bot commented Jul 27, 2021

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 21.53 KB (+0.13% 🔺)
@sentry/browser - Webpack 22.53 KB (0%)
@sentry/react - Webpack 22.56 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.95 KB (+0.12% 🔺)

Copy link
Contributor

@kamilogorek kamilogorek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with warn. Especially that we use it in logAndExitProcess in flush chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants