-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Use StandardError over Exception #775
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -1931,6 +1931,19 @@ end | |||
|
|||
Prefer the use of exceptions from the standard library over introducing new exception classes. | |||
|
|||
=== Do not `raise` `Exception` [[raise-exception]] | |||
|
|||
Use `StandardError` over `Exception`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this section should include a sentence about why one should not raise Exception
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you help with wording?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@denys281 Would "[Exception
] will bypass test frameworks and error reporters" do?
@marcandre Could you take a look? Cop w merged some time ago. |
This PR still needs work... |
Ping @denys281 |
Based on discussion: https://github.com/rubocop-hq/rubocop/pull/7325/files#r320964544
Rubocop issue: rubocop/rubocop#7299