From: Tobias Oetiker Date: Wed, 13 Jun 2007 16:51:06 +0000 (+0000) Subject: be more helpful when raising rb_eTypeError in string_arr string_arr_new(VALUE rb_stri... X-Git-Tag: 1.3rc2~148 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7704c3bf0f6067d1a814199a2589fe90b6b0fcce;p=thirdparty%2Frrdtool-1.x.git be more helpful when raising rb_eTypeError in string_arr string_arr_new(VALUE rb_strings). This patch indicates which index is in error as well as the type you are erroneously passing. -- anonymous git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1118 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/bindings/ruby/main.c b/bindings/ruby/main.c index 32bd8cff..aa082dda 100644 --- a/bindings/ruby/main.c +++ b/bindings/ruby/main.c @@ -49,7 +49,7 @@ string_arr string_arr_new( a.strings[i + 1] = strdup(buf); break; default: - rb_raise(rb_eTypeError, "invalid argument"); + rb_raise(rb_eTypeError, "invalid argument - %s, expected T_STRING or T_FIXNUM on index %d", rb_class2name(CLASS_OF(v)), i); break; } }