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

update with-sentry example #4859

Merged
merged 1 commit into from Aug 4, 2018
Merged

update with-sentry example #4859

merged 1 commit into from Aug 4, 2018

Conversation

Tomekmularczyk
Copy link
Contributor

@Tomekmularczyk Tomekmularczyk commented Jul 28, 2018

Changes:

  • moved the configuration from HOC to _app.js
  • fixed the example, as componentDidCatch catches errors during rendering phase, but not within event handlers.


componentDidCatch (error, errorInfo) {
this.setState({ error })
Raven.captureException(error, { extra: errorInfo })
Copy link
Member

Choose a reason for hiding this comment

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

This should have super.componentDidCatch(error, errorInfo) and the setState should be removed. Check the with-componentdidcatch example 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. I guess getInitialProps won't be needed here as well.

@avdeev
Copy link

avdeev commented Aug 2, 2018

rename SENTRY_DSN to SENTRY_PUBLIC_DSN, plz

@timneutkens timneutkens merged commit b1459bf into vercel:canary Aug 4, 2018
@Enalmada
Copy link
Contributor

FYI @Tomekmularczyk @avdeev The sentry docs example look different than the example. I assume raven has turned into @sentry/browser but please set me know if there is some reason next.js needs to use raven instead.

@timneutkens
Copy link
Member

@Enalmada I merged this yesterday: #5253

@lock lock bot locked as resolved and limited conversation to collaborators Sep 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants