Exception: KeyError
- Inherits:
-
IndexError
- Object
- Exception
- StandardError
- IndexError
- KeyError
- Defined in:
- error.c
Overview
Raised when the specified key is not found. It is a subclass of IndexError.
h = {"foo" => :bar}
h.fetch("foo") #=> :bar
h.fetch("baz") #=> KeyError: key not found: "baz"
Method Summary
Methods inherited from Exception
#==, #backtrace, #exception, exception, #initialize, #inspect, #message, #set_backtrace, #to_s
Constructor Details
This class inherits a constructor from Exception