-
-
Notifications
You must be signed in to change notification settings - Fork 757
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
Documentation for Exceptions RuleSet #640
Conversation
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.
(Y)
TODO: Specify description | ||
This rule reports `catch` blocks for exceptions that have a type that is too generic. | ||
It should be preferred to catch specific exceptions to the case that is currently handled. If the scope of the caught | ||
Exception is too broad it can lead to unintended exceptions being caught. |
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.
exception - lower case
This rule allows to define functions which should never throw an exception. If a function exists that does throw | ||
an exception it will be reported. By default this rule is checking for `toString`, `hashCode, `equals` and | ||
`finalize`. This rule is configurable via the `methodNames` configuration to change the list of functions which | ||
should not throw. |
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.
should not be thrown
@@ -194,7 +206,10 @@ fun foo() { | |||
|
|||
### ThrowingExceptionsWithoutMessageOrCause | |||
|
|||
TODO: Specify description | |||
This rule reports all exceptions which are thrown without arguments or further description. | |||
Exceptions should always call one of the constructor overloads to provide a message or a cause 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.
or a cause.
This rule reports all exceptions which are thrown without arguments or further description. | ||
Exceptions should always call one of the constructor overloads to provide a message or a cause exception. | ||
Exceptions should be meaningful and contain as much detail about the error case as possible. This will help track | ||
down an underlying issue in a better way. |
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.
to track down
Adds documentation for all rules in the exceptions RuleSet.
Relates to #496