Pattern: Inheritance from Exception
Issue: -
This rule looks for error classes inheriting from Exception
and its standard library subclasses, excluding subclasses of
StandardError
. It is configurable to suggest using either
RuntimeError
(default) or StandardError
instead.
# bad
class C < Exception; end
# EnforcedStyle: runtime_error (default)
# good
class C < RuntimeError; end
# EnforcedStyle: standard_error
# good
class C < StandardError; end
Attribute | Value |
---|---|
EnforcedStyle | runtime_error |
SupportedStyles | runtime_error, standard_error |