From: oetiker Date: Wed, 13 Jun 2007 16:50:23 +0000 (+0000) Subject: be more helpful when raising rb_eTypeError in string_arr string_arr_new(VALUE rb_stri... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1bb8ff090093007fc147a3fc8e79df6329750ce6;p=rrdtool-all.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/branches/1.2@1117 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/bindings/ruby/main.c b/program/bindings/ruby/main.c index b2eaa68e..94f17e19 100644 --- a/program/bindings/ruby/main.c +++ b/program/bindings/ruby/main.c @@ -43,7 +43,7 @@ string_arr string_arr_new(VALUE rb_strings) 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; } }