Skip to content

class KeyError
inherits Exception

Raised when the specified key is not found.

h = {"foo" => "bar"}
h["baz"] # raises KeyError (Missing hash key: "baz")