diff options
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -812,6 +812,21 @@ rb_name_error(ID id, const char *fmt, ...) rb_exc_raise(exc); } +void +rb_name_error_str(VALUE str, const char *fmt, ...) +{ + VALUE exc, argv[2]; + va_list args; + + va_start(args, fmt); + argv[0] = rb_vsprintf(fmt, args); + va_end(args); + + argv[1] = str; + exc = rb_class_new_instance(2, argv, rb_eNameError); + rb_exc_raise(exc); +} + /* * call-seq: * NameError.new(msg [, name]) -> name_error |