-
Notifications
You must be signed in to change notification settings - Fork 174
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
Add discard_classes option to support strings & regular expressions and deprecate ignore_classes #597
Add discard_classes option to support strings & regular expressions and deprecate ignore_classes #597
Conversation
75aed11
to
31f914c
Compare
This accepts Strings and Regexps rather than Classes and Procs, which is more inline with other Bugsnag notifiers It also doesn't walk the ancestor chain, which should lead to less false positives — with regexps especailly, this could be very dangerous!
31f914c
to
7d1c30f
Compare
Having defaults here is problematic for a few reasons, mainly that if someone is emptying `ignore_classes` then we'll break their app by re-adding those defaults to `discard_classes` We can move the values over when `ignore_classes` is removed
support of |
You should be able to use the newly added |
So is the suggested way to use |
Yeah I'd recommend using |
Goal
The
ignore_classes
option currently supportsClass
constants andProc
. Rails has recently deprecated autoloading in initialization (where Bugsnag is usually configured) which makesClass
constants unusable. Support forProc
is powerful but un-ergonomic when simply trying to ignore an error by class nameIn order to help bring the Ruby notifier in-line with other notifiers I've added
discard_classes
as a new option and deprecated the existingignore_classes
option.discard_classes
works similarly toignore_classes
, with these differences:String
orRegexp
rather thanClass
orProc
Linked issues
Fixes #589
Review
For the submitter, initial self-review:
For the pull request reviewer(s), this changeset has been reviewed for: