Built-in Exception Classes
- Exception
- The superclass of all exceptions.
- NoMemoryError
- Thrown when attempting to reserve too much memory at once.
- ScriptError
- Indicates a script error.
- NotImplementedError
- Thrown when an unimplemented feature is invoked.
- SyntaxError
- Thrown by a syntax error.
- StandardError
- This exception class and its subclass can be trapped
even when the class is omitted in the rescue clause.
- ArgumentError
- Thrown when argument numbers do not match or when the values are incorrect.
- IndexError
- Thrown when the index is out of range.
- IOError
- Thrown when an I/O error occurs.
- EOFError
- Thrown when EOF (end of file) has been reached.
- LocalJumpError
- Thrown when no jump destination is found for a control structure.
- NameError
- Thrown when using an undefined local variable or constant.
- NoMethodError
- Thrown when calling an undefined method.
- RangeError
- A range exception. Thrown in situations such as
when an out-of-range integer conversion (from Bignum to
Fixnum) occurs.
- FloatDomainError
- Thrown when trying to convert a positive or negative infinite number or
NaN (Not a Number) into Bignum ,
or when comparing a number to a NaN.
- RegexpError
- Thrown when compiling a regular expression fails.
- RuntimeError
- A runtime exception. Thrown when calling raise
without specifying an exception.
- SystemCallError
- Thrown when a system call fails.
- Errno::EXXX
- Exception class for each errno. See the Errno module
for more on each class name.
- SystemStackError
- Thrown when a stack level becomes too deep.
- TypeError
- Thrown when an illegal type is invoked.
- ZeroDivisionError
- Thrown when dividing by zero.
- SystemExit
- Terminates the program.
See exit for more information.
- fatal
- A fatal (internal) error. This object is not visible via the normal method.