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

[PLAT-4646] Implement discardClasses configuration option #938

Merged
merged 3 commits into from
Dec 15, 2020

Conversation

nickdowell
Copy link
Contributor

Goal

Implements the discardClasses configuration option which contains strings or regular expressions that, when the BugsnagError.errorClass matches, will cause the error to be discarded.

Design

For unhandled errors the evaluation is performed at next launch because it's not possible to evaluate regular expressions in an async-safe manner at crash time.

Changeset

  • Added discardClasses property to BugsnagConfiguration
  • Added -shouldDiscardErrorClass: method to BugsnagConfiguration
  • For handled errors: modified BugsnagClient to discard if -shouldDiscardErrorClass: returns YES
  • For unhandled errors: modified BugsnagErrorReportSink to discard if -shouldDiscardErrorClass: returns YES

Testing

  • Added unit tests to test -shouldDiscardErrorClass: with a variety of discardClasses values against a set of real-world error classes.
  • Added E2E test scenarios to verify that the expected errors are discarded, and that others are not.

[skip ci]
@nickdowell nickdowell changed the title Implement discardClasses configuration option [PLAT-4646] Implement discardClasses configuration option Dec 14, 2020
@nickdowell nickdowell merged commit 28daf3d into next Dec 15, 2020
@nickdowell nickdowell deleted the nickdowell/discard-classes branch December 15, 2020 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants