Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.4k
Open
Description
I proposed PRrubocop/rubocop#13352 to add a newLint/NoRescueErrorMessageChecking
cop that discourages rescue error matching. We built a custom cop at my company and thought it might be useful to roll it out as built in cop.
I was suggested by@dvandersluis to reach out to the community for feedback whether its a useful cop or not.
# badbegin somethingrescue => e if e.message.match?(/Duplicate entry/) handle_error endend# badbegin somethingrescue => e unless e.message.match?(/Duplicate entry/) handle_error endend# goodbegin somethingrescue ActiveRecord::RecordNotUnique => e handle_errorend
Metadata
Metadata
Assignees
Labels
No labels