Module: Properb::AllExceptionsExceptOnesWeMustNotRescue

Defined in:
lib/properb.rb

Overview

This definition is taken from RSpec, in an attempt to remain consistent with them.

Constant Summary collapse

AVOID_RESCUING =

These exceptions are dangerous to rescue as rescuing them would interfere with things we should not interfere with.

[NoMemoryError, SignalException, Interrupt, SystemExit].freeze

Class Method Summary collapse

Class Method Details

.===(exception) ⇒ Object



17
18
19
# File 'lib/properb.rb', line 17

def self.===(exception)
  exception.is_a?(Exception) && !AVOID_RESCUING.any? { exception.is_a?(_1) }
end