Exception: StandardError
Overview
The most standard error types are subclasses of StandardError. A rescue clause without an explicit Exception class will rescue all StandardErrors (and only those).
def foo
raise "Oups"
end
foo rescue "Hello" #=> "Hello"
On the other hand:
require 'does/not/exist' rescue "Hi"
raises the exception:
LoadError: no such file to load -- does/not/exist
Direct Known Subclasses
ArgumentError, EncodingError, FiberError, IOError, IndexError, LocalJumpError, Math::DomainError, NameError, RangeError, RegexpError, RuntimeError, SystemCallError, ThreadError, TypeError, ZeroDivisionError
Method Summary
Methods inherited from Exception
#==, #backtrace, #backtrace_locations, #cause, #exception, exception, #initialize, #inspect, #message, #set_backtrace, #to_s
Constructor Details
This class inherits a constructor from Exception