Project

General

Profile

Feature #15999

KeyError#inspect does not contain receiver and key

Added by znz (Kazuhiro NISHIYAMA) 8 days ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:93748]

Description

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>"

Also available in: Atom PDF