abort(*args)
public
Terminate execution immediately, effectively by calling Kernel.exit(false).
If msg is given, it is written to STDERR prior to terminating.
Show source
VALUE
rb_f_abort(int argc, const VALUE *argv)
{
rb_check_arity(argc, 0, 1);
if (argc == 0) {
rb_execution_context_t *ec = GET_EC();
VALUE errinfo = ec->errinfo;
if (!NIL_P(errinfo)) {
rb_ec_error_print(ec, errinfo);
}
rb_exit(EXIT_FAILURE);
}
else {
VALUE args[2];
args[1] = args[0] = argv[0];
StringValue(args[0]);
rb_io_puts(1, args, rb_stderr);
args[0] = INT2NUM(EXIT_FAILURE);
rb_exc_raise(rb_class_new_instance(2, args, rb_eSystemExit));
}
UNREACHABLE;
}