Skip to content

docs: Add warning about react errors and default ignores #840

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

Merged
merged 1 commit into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ _Import name: `Sentry.Integrations.InboundFilter`_

This integration allows developers to ignore specific errors based on the type or message,
as well as blacklist/whitelist urls which exception originates from.
It ignores errors, which message starts with `Script error` or `Javascript error: Script error` by default.
More on this in our ["What the heck is "Script error"?"](https://blog.sentry.io/2016/05/17/what-is-script-error) blog post.

To configure it, use `ignoreErrors`, `blacklistUrls` and `whitelistUrls` SDK options directly.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ This integration deduplicates certain events. The Sentry SDK enables this by def
_Import name: `Sentry.Integrations.InboundFilter`_

This integration allows developers to ignore specific errors based on the type or message, as well as blacklist/whitelist URLs that originate from the exception.
It ignores errors, which message starts with `Script error` or `Javascript error: Script error` by default. More on this in our ["What the heck is "Script error"?"](https://blog.sentry.io/2016/05/17/what-is-script-error) blog post.

To configure it, use `ignoreErrors`, `blacklistUrls`, and `whitelistUrls` SDK options directly.

Expand Down
9 changes: 9 additions & 0 deletions src/collections/_documentation/platforms/javascript/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ On its own, `@sentry/browser` will report any uncaught exceptions triggered from

If you’re using React 16 or above, Error Boundaries are an important tool for defining the behavior of your application in the face of errors. Be sure to send errors they catch to Sentry using `Sentry.captureException`, and optionally this is also a great opportunity to surface User Feedback

{% capture __alert_content -%}
One important thing to note about the behavior of error boundaries in development mode is that React will rethrow errors they catch. This will result in errors being reported twice to Sentry with the above setup, but this won’t occur in your production build.
{%- endcapture -%}
{%- include components/alert.html
title="Note"
content=__alert_content
level="info"
%}

```jsx
import * as Sentry from '@sentry/browser';

Expand Down