KeyError from Hash#fetch should inspect key.

To distinguish string keys and symbol keys.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-12-25 23:52:40 +09:00
parent e4a9b4a3ad
commit ad17ba0e11
+1 -1
View File
@@ -165,7 +165,7 @@ class Hash
elsif none != NONE
none
else
raise KeyError, "Key not found: #{key}"
raise KeyError, "Key not found: #{key.inspect}"
end
else
self[key]