aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-24 03:47:40 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-24 03:47:40 +0000
commit27eb499513d99908c21ff071d37cbd48b60704a9 (patch)
treeab82e27cb07e2049bd70c85a479eab616b7d5699 /vm_insnhelper.c
parent216a6b12e80a6d1737f43aff576e0b3da898703b (diff)
downloadruby-27eb499513d99908c21ff071d37cbd48b60704a9.tar.gz
vm_insnhelper.c: improved error message for "wrong number
of arguments", distinguishing given and expected argument numbers clearly. [Feature #9025] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 7f4a371423..07b7b02385 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -216,13 +216,13 @@ rb_arity_error_new(int argc, int min, int max)
{
VALUE err_mess = 0;
if (min == max) {
- err_mess = rb_sprintf("wrong number of arguments (%d for %d)", argc, min);
+ err_mess = rb_sprintf("wrong number of arguments (given %d, expected %d)", argc, min);
}
else if (max == UNLIMITED_ARGUMENTS) {
- err_mess = rb_sprintf("wrong number of arguments (%d for %d+)", argc, min);
+ err_mess = rb_sprintf("wrong number of arguments (given %d, expected %d+)", argc, min);
}
else {
- err_mess = rb_sprintf("wrong number of arguments (%d for %d..%d)", argc, min, max);
+ err_mess = rb_sprintf("wrong number of arguments (given %d, expected %d..%d)", argc, min, max);
}
return rb_exc_new3(rb_eArgError, err_mess);
}