Permalink
Browse files

* exception message clean-up by Ian Macdonald <ian@caliban.org>.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 6a738f2 commit 919f456de88e9e1011db8f6e4e484e1b25e77af4 matz committed Mar 29, 2004
View
@@ -1774,7 +1774,7 @@ rb_ary_select(argc, argv, ary)
long i;
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments (%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
result = rb_ary_new2(RARRAY(ary)->len);
for (i = 0; i < RARRAY(ary)->len; i++) {
View
@@ -1017,7 +1017,7 @@ rb_scan_args(argc, argv, fmt, va_alist)
}
if (argc > i) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)", argc, i);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, i);
}
return argc;
View
20 eval.c
@@ -3639,7 +3639,7 @@ rb_eval(self, n)
case NODE_ATTRSET:
if (ruby_frame->argc != 1)
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 1)",
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)",
ruby_frame->argc);
result = rb_ivar_set(self, node->nd_vid, ruby_frame->argv[0]);
break;
@@ -4853,7 +4853,7 @@ massign(self, node, val, pcall)
}
if (pcall && list) goto arg_error;
if (node->nd_args) {
- if (node->nd_args == (NODE*)-1) {
+ if ((long)(node->nd_args) == -1) {
/* no check for mere `*' */
}
else if (!list && i<len) {
@@ -5333,7 +5333,7 @@ call_cfunc(func, recv, len, argc, argv)
VALUE *argv;
{
if (len >= 0 && argc != len) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)",
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
argc, len);
}
@@ -5484,7 +5484,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
/* for attr get/set */
case NODE_IVAR:
if (argc != 0) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
result = rb_attr_get(recv, body->nd_vid);
break;
@@ -5547,10 +5547,10 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
i = node->nd_cnt;
if (i > argc) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)",
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
argc, i);
}
- if ((int)node->nd_rest == -1) {
+ if ((long)node->nd_rest == -1) {
int opt = i;
NODE *optnode = node->nd_opt;
@@ -5559,7 +5559,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
optnode = optnode->nd_next;
}
if (opt < argc) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)",
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
argc, opt);
}
ruby_frame->argc = opt;
@@ -5585,7 +5585,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
}
}
local_vars = ruby_scope->local_vars;
- if ((int)node->nd_rest >= 0) {
+ if ((long)node->nd_rest >= 0) {
VALUE v;
if (argc > 0)
@@ -7196,7 +7196,7 @@ rb_obj_extend(argc, argv, obj)
int i;
if (argc == 0) {
- rb_raise(rb_eArgError, "wrong number of arguments(0 for 1)");
+ rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)");
}
for (i=0; i<argc; i++) Check_Type(argv[i], T_MODULE);
while (argc--) {
@@ -9096,7 +9096,7 @@ rb_mod_define_method(argc, argv, mod)
}
}
else {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 1)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
}
if (RDATA(body)->dmark == (RUBY_DATA_FUNC)bm_mark) {
struct METHOD *method = (struct METHOD *)DATA_PTR(body);
View
@@ -601,7 +601,7 @@ iconv_s_iconv
struct iconv_env_t arg;
if (argc < 2) /* needs `to' and `from' arguments at least */
- rb_raise(rb_eArgError, "wrong # of arguments (%d for %d)", argc, 2);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, 2);
arg.argc = argc -= 2;
arg.argv = argv + 2;
View
@@ -63,7 +63,7 @@ ossl_x509_ary2sk0(VALUE ary)
val = rb_ary_entry(ary, i);
if (!rb_obj_is_kind_of(val, cX509Cert)) {
sk_X509_pop_free(sk, X509_free);
- ossl_raise(eOSSLError, "object except X509 cert is in array");
+ ossl_raise(eOSSLError, "object not X509 cert in array");
}
x509 = DupX509CertPtr(val); /* NEED TO DUP */
sk_X509_push(sk, x509);
View
@@ -567,7 +567,7 @@ ossl_asn1_default_tag(VALUE obj)
return i;
}
}
- ossl_raise(eASN1Error, "not found universal tag for %s",
+ ossl_raise(eASN1Error, "universal tag for %s not found",
rb_class2name(CLASS_OF(obj)));
return -1; /* dummy */
@@ -650,7 +650,7 @@ ossl_asn1data_initialize(VALUE self, VALUE value, VALUE tag, VALUE tag_class)
if(!SYMBOL_P(tag_class))
ossl_raise(eASN1Error, "invalid tag class");
if((SYM2ID(tag_class) == sUNIVERSAL) && NUM2INT(tag) > 31)
- ossl_raise(eASN1Error, "too large tag number for Universal");
+ ossl_raise(eASN1Error, "tag number for Universal too large");
ossl_asn1_set_tag(self, tag);
ossl_asn1_set_value(self, value);
ossl_asn1_set_tag_class(self, tag_class);
@@ -865,13 +865,13 @@ ossl_asn1_initialize(int argc, VALUE *argv, VALUE self)
if(NIL_P(tagging))
tagging = ID2SYM(sEXPLICIT);
if(!SYMBOL_P(tagging))
- ossl_raise(eASN1Error, "invelid tag default");
+ ossl_raise(eASN1Error, "invalid tag default");
if(NIL_P(tag_class))
tag_class = ID2SYM(sCONTEXT_SPECIFIC);
if(!SYMBOL_P(tag_class))
- ossl_raise(eASN1Error, "invelid tag class");
+ ossl_raise(eASN1Error, "invalid tag class");
if(SYM2ID(tagging) == sIMPLICIT && NUM2INT(tag) > 31)
- ossl_raise(eASN1Error, "too large tag number for Universal");
+ ossl_raise(eASN1Error, "tag number for Universal too large");
}
else{
tag = INT2NUM(ossl_asn1_default_tag(self));
@@ -147,7 +147,7 @@ ossl_config_initialize(int argc, VALUE *argv, VALUE self)
}
}
#ifdef OSSL_NO_CONF_API
- else rb_raise(rb_eArgError, "wrong number of arguments(0 for 1)");
+ else rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)");
#else
else _CONF_new_data(conf);
#endif
View
@@ -358,7 +358,7 @@ ossl_pkcs7_set_detached(VALUE self, VALUE flag)
GetPKCS7(self, p7);
if(flag != Qtrue && flag != Qfalse)
- ossl_raise(ePKCS7Error, "must secify a boolean");
+ ossl_raise(ePKCS7Error, "must specify a boolean");
if(!PKCS7_set_detached(p7, flag == Qtrue ? 1 : 0))
ossl_raise(ePKCS7Error, NULL);
View
@@ -733,7 +733,7 @@ reduce0(val, data, self)
/* calculate transition state */
if (RARRAY(v->state)->len == 0)
- rb_raise(RaccBug, "state stack unexpected empty");
+ rb_raise(RaccBug, "state stack unexpectedly empty");
k2 = num_to_long(LAST_I(v->state));
k1 = num_to_long(reduce_to) - v->nt_base;
D_printf("(goto) k1=%ld\n", k1);
View
@@ -83,7 +83,7 @@ readline_s_set_completion_proc(self, proc)
VALUE proc;
{
if (!rb_respond_to(proc, rb_intern("call")))
- rb_raise(rb_eArgError, "argument have to respond to `call'");
+ rb_raise(rb_eArgError, "argument must respond to `call'");
return rb_iv_set(mReadline, COMPLETION_PROC, proc);
}
View
@@ -227,7 +227,7 @@ fsdbm_select(argc, argv, obj)
struct dbmdata *dbmp;
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
GetDBM(obj, dbmp);
dbm = dbmp->di_dbm;
View
@@ -879,7 +879,7 @@ strio_read(argc, argv, self)
}
break;
default:
- rb_raise(rb_eArgError, "wrong number arguments (%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
if (NIL_P(str)) {
str = rb_str_substr(ptr->string, ptr->pos, len);
View
@@ -146,7 +146,7 @@ static VALUE mSyslog_log(int argc, VALUE *argv, VALUE self)
VALUE pri;
if (argc < 2) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2+)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 2+)", argc);
}
argc--;
View
@@ -811,7 +811,7 @@ ip_ruby(clientData, interp, argc, argv)
/* ruby command has 1 arg. */
if (argc != 2) {
- rb_raise(rb_eArgError, "wrong # of arguments (%d for 1)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
}
/* get C string from Tcl object */
Oops, something went wrong.

0 comments on commit 919f456

Please sign in to comment.