I
Iñaki Baz Castillo
Hi, I'm trying to create a CustomError exception in a Ruby C extension and =
raise it:
VALUE class_standard_error =3D rb_const_get(rb_cObject, rb_intern("Standa=
rdError"));
VALUE class_custom_error =3D rb_define_class_under(class_standard_error, =
"ClassError", rb_cObject);
rb_raise(class_custom_error, "Oh, a custom error occurred !!!");
Unfortunatelly when running it I get:
ArgumentError: wrong number of arguments(1 for 0)
./test_unit.rb:22:in `initialize'
./test_unit.rb:22:in `new'
./test_unit.rb:22:in `my_function'
./test_unit.rb:22:in `test_01
Being "my_function" the Ruby method calling to the above C code.
I suspect that the line:
rb_raise(class_custom_error, "Oh, a custom error occurred !!!");
is not correct. How should look the first argument?
Thanks a lot.
=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>
raise it:
VALUE class_standard_error =3D rb_const_get(rb_cObject, rb_intern("Standa=
rdError"));
VALUE class_custom_error =3D rb_define_class_under(class_standard_error, =
"ClassError", rb_cObject);
rb_raise(class_custom_error, "Oh, a custom error occurred !!!");
Unfortunatelly when running it I get:
ArgumentError: wrong number of arguments(1 for 0)
./test_unit.rb:22:in `initialize'
./test_unit.rb:22:in `new'
./test_unit.rb:22:in `my_function'
./test_unit.rb:22:in `test_01
Being "my_function" the Ruby method calling to the above C code.
I suspect that the line:
rb_raise(class_custom_error, "Oh, a custom error occurred !!!");
is not correct. How should look the first argument?
Thanks a lot.
=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>