raise-exception
What it does
Section titled “What it does”Reports raise Exception and raise Exception.new.
Why it matters
Section titled “Why it matters”A plain rescue does not catch Exception, only StandardError, so the error goes past every handler that is written for normal errors and ends the program.
To fix, raise StandardError or a subclass.
Example
Section titled “Example”...raise Exception, "m"raise StandardError...foo (a ? b : c)...Configuration
Section titled “Configuration”ruby: lint: rules: raise-exception: warn # off (default), warn, errorEnabled by the presets: ruby/rubocop.
Suppress one line with sudsy-disable-next-line raise-exception in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| rubocop | Lint/RaiseException |
full |