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

Add Lint/RescueWithoutErrorClass #23

Closed
no-reply opened this issue Feb 16, 2018 · 3 comments
Closed

Add Lint/RescueWithoutErrorClass #23

no-reply opened this issue Feb 16, 2018 · 3 comments

Comments

@no-reply
Copy link

See: samvera/hyrax#2655 (comment)

@no-reply
Copy link
Author

Actually, we want Style/RescueStandardError.

@no-reply
Copy link
Author

I expressed some concerns about the Lint/RescueWithoutErrorClass rule here: samvera/hyrax#2655 (comment)

To elaborate. I think it's a pretty common use case for some code (e.g. a Controller) to catch all errors, do some work (log, add a flash message, etc...), and/or reraise with a localized error type.

That cop has been removed, and replaced with Style/RescueStandardError. By default, this cop ensures that rescue StandardError is explicitly specified. My sense is that this is a positive development, and that we should enable the new cop.

@jrochkind
Copy link

i agree that rescuing StandardError as long as you are re-raising (original or with a custom module-specific exception class wrapping the original) is both perfectly acceptable and a common thing I do.

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

No branches or pull requests

2 participants