summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-18 08:05:53 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-18 08:05:53 (GMT)
commit13f5dcb9f25cf07ef22baa5aded490395700b283 (patch)
tree5678b3e222c96077a2eb8e7a80e21dd5dbef1d3e /sprintf.c
parent2627c19d82252f2bb571f6bcb44e359cacefa92b (diff)
error.c: KeyError#receiver and KeyError#key
* error.c: new method KeyError#receiver and KeyError#key. [Feature #12063] * hash.c: make KeyError object with receiver and key. * sprintf.c: ditto. Author: ksss <co000ri@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sprintf.c b/sprintf.c
index 2bd4966..a956381 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -633,7 +633,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
}
nextvalue = rb_hash_default_value(hash, sym);
if (NIL_P(nextvalue)) {
- rb_enc_raise(enc, rb_eKeyError, "key%.*s not found", len, start);
+ rb_key_err_raise(rb_enc_sprintf(enc, "key%.*s not found", len, start), hash, sym);
}
}
if (term == '}') goto format_s;