From f1f04caf60e4fc9dc3b12109e0be831f2d692810 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Mon, 27 May 2019 17:52:35 -0700 Subject: Include inspect value of object in FrozenError messages FrozenError#receiver was added recently for getting the related object programmatically. However, there are cases where FrozenError is raised and not handled, and in those cases the resulting error messages lack detail, which makes debugging the error more difficult, especially in cases where the error is not easily reproducible. This includes the inspect value of the frozen object in FrozenError messages, which should make debugging simpler. --- eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index b9643803d5..fa3ec22af5 100644 --- a/eval.c +++ b/eval.c @@ -454,7 +454,7 @@ rb_class_modify_check(VALUE klass) goto noclass; } } - rb_frozen_error_raise(klass, "can't modify frozen %s", desc); + rb_frozen_error_raise(klass, "can't modify frozen %s: %"PRIsVALUE, desc, klass); } } -- cgit v1.2.3