[ruby-core:93748] [Ruby master Feature#15999] KeyError#inspect does not contain receiver and key
From:
zn@...
Date:
2019-07-14 07:31:12 UTC
List:
ruby-core #93748
Issue #15999 has been reported by znz (Kazuhiro NISHIYAMA).
----------------------------------------
Feature #15999: KeyError#inspect does not contain receiver and key
https://bugs.ruby-lang.org/issues/15999
* Author: znz (Kazuhiro NISHIYAMA)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
Some exception classes accept `receiver:`, but `#inspect` does not show such information.
How about adding receiver (and key) to `#inspect`?
```
KeyError.new("message", receiver: :receiver, key: :key).inspect #=> "#<KeyError: message>"
NameError.new("message", receiver: :receiver).inspect #=> "#<NameError: message>"
NoMethodError.new("message", receiver: :receiver).inspect #=> "#<NoMethodError: message>"
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>