abort(...)
public
Terminate execution immediately, effectively by calling
Kernel.exit(1). If msg is given, it is written to STDERR
prior to terminating.
Show source
/*
* call-seq:
* abort
* Kernel::abort
* Process::abort
*
* Terminate execution immediately, effectively by calling
* <code>Kernel.exit(1)</code>. If _msg_ is given, it is written
* to STDERR prior to terminating.
*/
VALUE
rb_f_abort(argc, argv)
int argc;
VALUE *argv;
{
rb_secure(4);
if (argc == 0) {
if (!NIL_P(ruby_errinfo)) {
error_print();
}
rb_exit(EXIT_FAILURE);
}
else {
VALUE mesg;
rb_scan_args(argc, argv, "1", &mesg);
StringValue(mesg);
rb_io_puts(1, &mesg, rb_stderr);
terminate_process(EXIT_FAILURE, mesg);
}
return Qnil; /* not reached */
}