class RuboCop::Cop::Lint::InheritException

Looks for error classes inheriting from ‘Exception`. It is configurable to suggest using either `StandardError` (default) or `RuntimeError` instead.

@safety

This cop's autocorrection is unsafe because `rescue` that omit
exception class handle `StandardError` and its subclasses,
but not `Exception` and its subclasses.

@example EnforcedStyle: standard_error (default)

# bad

class C < Exception; end

C = Class.new(Exception)

# good

class C < StandardError; end

C = Class.new(StandardError)

@example EnforcedStyle: runtime_error

# bad

class C < Exception; end

C = Class.new(Exception)

# good

class C < RuntimeError; end

C = Class.new(RuntimeError)