Inherit from RuntimeError
instead of Exception
. Open
class CommandError < Exception; end
- Read upRead up
- Exclude checks
This cop 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.
Example: EnforcedStyle: runtime_error (default)
# bad
class C < Exception; end
# good
class C < RuntimeError; end
Example: EnforcedStyle: standard_error
# bad
class C < Exception; end
# good
class C < StandardError; end
Inherit from RuntimeError
instead of Exception
. Open
class ConnectFailure < Exception; end
- Read upRead up
- Exclude checks
This cop 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.
Example: EnforcedStyle: runtime_error (default)
# bad
class C < Exception; end
# good
class C < RuntimeError; end
Example: EnforcedStyle: standard_error
# bad
class C < Exception; end
# good
class C < StandardError; end
Inherit from RuntimeError
instead of Exception
. Open
class ExpectedPromptFailure < Exception; end
- Read upRead up
- Exclude checks
This cop 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.
Example: EnforcedStyle: runtime_error (default)
# bad
class C < Exception; end
# good
class C < RuntimeError; end
Example: EnforcedStyle: standard_error
# bad
class C < Exception; end
# good
class C < StandardError; end
Inherit from RuntimeError
instead of Exception
. Open
class InvalidExpressionError < Exception; end
- Read upRead up
- Exclude checks
This cop 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.
Example: EnforcedStyle: runtime_error (default)
# bad
class C < Exception; end
# good
class C < RuntimeError; end
Example: EnforcedStyle: standard_error
# bad
class C < Exception; end
# good
class C < StandardError; end
Inherit from RuntimeError
instead of Exception
. Open
class UnexpectedOutputError < Exception; end
- Read upRead up
- Exclude checks
This cop 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.
Example: EnforcedStyle: runtime_error (default)
# bad
class C < Exception; end
# good
class C < RuntimeError; end
Example: EnforcedStyle: standard_error
# bad
class C < Exception; end
# good
class C < StandardError; end
Inherit from RuntimeError
instead of Exception
. Open
class MissingOptionError < Exception; end
- Read upRead up
- Exclude checks
This cop 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.
Example: EnforcedStyle: runtime_error (default)
# bad
class C < Exception; end
# good
class C < RuntimeError; end
Example: EnforcedStyle: standard_error
# bad
class C < Exception; end
# good
class C < StandardError; end
Inherit from RuntimeError
instead of Exception
. Open
class NotConnectedError < Exception; end
- Read upRead up
- Exclude checks
This cop 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.
Example: EnforcedStyle: runtime_error (default)
# bad
class C < Exception; end
# good
class C < RuntimeError; end
Example: EnforcedStyle: standard_error
# bad
class C < Exception; end
# good
class C < StandardError; end
Inherit from RuntimeError
instead of Exception
. Open
class VersionParseError < Exception; end
- Read upRead up
- Exclude checks
This cop 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.
Example: EnforcedStyle: runtime_error (default)
# bad
class C < Exception; end
# good
class C < RuntimeError; end
Example: EnforcedStyle: standard_error
# bad
class C < Exception; end
# good
class C < StandardError; end
Inherit from RuntimeError
instead of Exception
. Open
class ConfigModeError < Exception; end
- Read upRead up
- Exclude checks
This cop 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.
Example: EnforcedStyle: runtime_error (default)
# bad
class C < Exception; end
# good
class C < RuntimeError; end
Example: EnforcedStyle: standard_error
# bad
class C < Exception; end
# good
class C < StandardError; end