Ruby: Exception handlings

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

Data Structures | Macros | Enumerations | Functions | Variables
Exception handlings

## Data Structures
struct | bug_reporters

## Macros
#define | EXIT_SUCCESS 0
#define | WIFEXITED(status)
#define | WEXITSTATUS(status)
#define | with_warn_vsprintf(file, line, fmt)
#define | with_warning_string(mesg, enc, fmt)
#define | with_warning_string_from(mesg, enc, fmt, last_arg)
#define | MAX_BUG_REPORTERS 0x100
#define | REPORT_BUG_BUFSIZ 256
#define | bug_report_begin(out, fmt)
#define | report_bug(file, line, fmt, ctx)
#define | report_bug_valist(file, line, fmt, ctx, args)
#define | write_or_abort(fd, str, len)
#define | WRITE_CONST(fd, str)
#define | UNDEF_LEAKED "undef leaked to the Ruby space"
#define | id_cause ruby_static_id_cause
#define | id_bt idBt
#define | id_bt_locations idBt_locations
#define | id_mesg idMesg
#define | id_name idName
#define | frozen_err_receiver name_err_receiver
#define | name_err_mesg_free RUBY_TYPED_DEFAULT_FREE
#define | ruby_verbose (*rb_ruby_verbose_ptr())
| This variable controls whether the interpreter is in debug mode.
#define | ruby_debug (*rb_ruby_debug_ptr())
| This variable controls whether the interpreter is in debug mode.

## Enumerations
enum | { NAME_ERR_MESG__MESG , NAME_ERR_MESG__RECV , NAME_ERR_MESG__NAME , NAME_ERR_MESG_COUNT }
enum | rb_warning_category_t { RB_WARN_CATEGORY_NONE , RB_WARN_CATEGORY_DEPRECATED , RB_WARN_CATEGORY_EXPERIMENTAL , RB_WARN_CATEGORY_ALL_BITS = 0x6 }
| Warning categories. More...
enum | rb_io_wait_readwrite { RB_IO_WAIT_READABLE , RB_IO_WAIT_WRITABLE }
| for rb_readwrite_sys_fail first argument More...

## Functions
VALUE | rb_iseqw_local_variables (VALUE iseqval)
VALUE | rb_iseqw_new (const rb_iseq_t *)
int | rb_str_end_with_asciichar (VALUE str, int c)
static const char * | rb_strerrno (int err)
static int | err_position_0 (char *buf, long len, const char *file, int line)
static VALUE | err_vcatf (VALUE str, const char *pre, const char *file, int line, const char *fmt, va_list args)
static VALUE | syntax_error_with_path (VALUE, VALUE, VALUE *, rb_encoding *)
VALUE | rb_syntax_error_append (VALUE exc, VALUE file, int line, int column, rb_encoding *enc, const char *fmt, va_list args)
static unsigned int | rb_warning_category_mask (VALUE category)
rb_warning_category_t | rb_warning_category_from_name (VALUE category)
static VALUE | rb_warning_category_to_name (rb_warning_category_t category)
void | rb_warning_category_update (unsigned int mask, unsigned int bits)
bool | rb_warning_category_enabled_p (rb_warning_category_t category)
static VALUE | rb_warning_s_aref (VALUE mod, VALUE category)
static VALUE | rb_warning_s_aset (VALUE mod, VALUE category, VALUE flag)
static VALUE | rb_warning_s_warn (int argc, VALUE *argv, VALUE mod)
static VALUE | rb_warning_warn (VALUE mod, VALUE str)
static int | rb_warning_warn_arity (void)
static VALUE | rb_warn_category (VALUE str, VALUE category)
static void | rb_write_warning_str (VALUE str)
static VALUE | warn_vsprintf (rb_encoding *enc, const char *file, int line, const char *fmt, va_list args)
void | rb_compile_warn (const char *file, int line, const char *fmt,...)
| Identical to rb_compile_warning(), except it reports always regardless of runtime `-W` flag.
void | rb_compile_warning (const char *file, int line, const char *fmt,...)
| Issues a compile-time warning that happens at `__file__:__line__`.
void | rb_category_compile_warn (rb_warning_category_t cat, const char *file, int line, const char *fmt,...)
| Identical to rb_compile_warn(), except it also accepts category.
static VALUE | warning_string (rb_encoding *enc, const char *fmt, va_list args)
void | rb_warn (const char *fmt,...)
| Identical to rb_warning(), except it reports always regardless of runtime `-W` flag.
void | rb_category_warn (rb_warning_category_t cat, const char *fmt,...)
| Identical to rb_category_warning(), except it reports always regardless of runtime `-W` flag.
void | rb_enc_warn (rb_encoding *enc, const char *fmt,...)
void | rb_warning (const char *fmt,...)
| Issues a warning.
void | rb_category_warning (rb_warning_category_t cat, const char *fmt,...)
| Identical to rb_warning(), except it takes additional "category" parameter.
VALUE | rb_warning_string (const char *fmt,...)
static bool | deprecation_warning_enabled (void)
static void | warn_deprecated (VALUE mesg, const char *removal, const char *suggest)
void | rb_warn_deprecated (const char *fmt, const char *suggest,...)
void | rb_warn_deprecated_to_remove (const char *removal, const char *fmt, const char *suggest,...)
static int | end_with_asciichar (VALUE str, int c)
static VALUE | warning_write (int argc, VALUE *argv, VALUE buf)
VALUE | rb_ec_backtrace_location_ary (const rb_execution_context_t *ec, long lev, long n, bool skip_internal)
static VALUE | rb_warn_m (rb_execution_context_t *ec, VALUE exc, VALUE msgs, VALUE uplevel, VALUE category)
int | rb_bug_reporter_add (void(*func)(FILE *, void *), void *data)
static FILE * | bug_report_file (const char *file, int line)
| FUNC_MINIMIZED (static void bug_important_message(FILE *out, const char *const msg, size_t len))
static void | bug_important_message (FILE *out, const char *const msg, size_t len)
static void | preface_dump (FILE *out)
static void | postscript_dump (FILE *out)
static void | bug_report_begin_valist (FILE *out, const char *fmt, va_list args)
static void | bug_report_end (FILE *out)
static void | die (void)
void | rb_bug_without_die (const char *fmt, va_list args)
void | rb_bug (const char *fmt,...)
| Interpreter panic switch.
void | rb_bug_for_fatal_signal (ruby_sighandler_t default_sighandler, int sig, const void *ctx, const char *fmt,...)
void | rb_bug_errno (const char *msg, int err)
| This is a wrapper of rb_bug() which automatically constructs appropriate message from the passed errno.
void | rb_async_bug_errno (const char *mesg, int errno_arg)
void | rb_report_bug_valist (VALUE file, int line, const char *fmt, va_list args)
void | rb_assert_failure (const char *file, int line, const char *name, const char *expr)
const char * | rb_builtin_type_name (int t)
static VALUE | displaying_class_of (VALUE x)
static const char * | builtin_class_name (VALUE x)
const char * | rb_builtin_class_name (VALUE x)
static void | unexpected_type (VALUE, int, int)
void | rb_check_type (VALUE x, int t)
| This was the old implementation of Check_Type(), but they diverged.
void | rb_unexpected_type (VALUE self, int t)
| Fails with the given object's type incompatibility to the type.
int | rb_typeddata_inherited_p (const rb_data_type_t *child, const rb_data_type_t *parent)
| Checks for the domestic relationship between the two.
int | rb_typeddata_is_kind_of (VALUE obj, const rb_data_type_t *data_type)
| Checks if the given object is of given kind.
int | rb_typeddata_is_instance_of (VALUE obj, const rb_data_type_t *data_type)
void * | rb_check_typeddata (VALUE obj, const rb_data_type_t *data_type)
| Identical to rb_typeddata_is_kind_of(), except it raises exceptions instead of returning false.
VALUE | rb_exc_new (VALUE etype, const char *ptr, long len)
| Creates an instance of the passed exception class.
VALUE | rb_exc_new_cstr (VALUE etype, const char *s)
| Identical to rb_exc_new(), except it assumes the passed pointer is a pointer to a C string.
VALUE | rb_exc_new_str (VALUE etype, VALUE str)
| Identical to rb_exc_new_cstr(), except it takes a Ruby's string instead of C's.
static VALUE | exc_init (VALUE exc, VALUE mesg)
static VALUE | exc_initialize (int argc, VALUE *argv, VALUE exc)
static VALUE | exc_exception (int argc, VALUE *argv, VALUE self)
static VALUE | exc_to_s (VALUE exc)
void | rb_error_write (VALUE errinfo, VALUE emesg, VALUE errat, VALUE str, VALUE opt, VALUE highlight, VALUE reverse)
VALUE | rb_get_message (VALUE exc)
VALUE | rb_get_detailed_message (VALUE exc, VALUE opt)
static VALUE | exc_s_to_tty_p (VALUE self)
static VALUE | check_highlight_keyword (VALUE opt, int auto_tty_detect)
static VALUE | check_order_keyword (VALUE opt)
static VALUE | exc_full_message (int argc, VALUE *argv, VALUE exc)
static VALUE | exc_message (VALUE exc)
static VALUE | exc_detailed_message (int argc, VALUE *argv, VALUE exc)
static VALUE | exc_inspect (VALUE exc)
static VALUE | exc_backtrace (VALUE exc)
static VALUE | rb_check_backtrace (VALUE)
VALUE | rb_get_backtrace (VALUE exc)
static VALUE | exc_backtrace_locations (VALUE exc)
static VALUE | exc_set_backtrace (VALUE exc, VALUE bt)
VALUE | rb_exc_set_backtrace (VALUE exc, VALUE bt)
static VALUE | exc_cause (VALUE exc)
static VALUE | try_convert_to_exception (VALUE obj)
static VALUE | exc_equal (VALUE exc, VALUE obj)
static VALUE | exit_initialize (int argc, VALUE *argv, VALUE exc)
static VALUE | exit_status (VALUE exc)
static VALUE | exit_success_p (VALUE exc)
static VALUE | err_init_recv (VALUE exc, VALUE recv)
static VALUE | frozen_err_initialize (int argc, VALUE *argv, VALUE self)
void | rb_name_error (ID id, const char *fmt,...)
| Raises an instance of rb_eNameError.
void | rb_name_error_str (VALUE str, const char *fmt,...)
| Identical to rb_name_error(), except it takes a VALUE instead of ID.
static VALUE | name_err_init_attr (VALUE exc, VALUE recv, VALUE method)
static VALUE | name_err_initialize (int argc, VALUE *argv, VALUE self)
static VALUE | rb_name_err_mesg_new (VALUE mesg, VALUE recv, VALUE method)
static VALUE | name_err_init (VALUE exc, VALUE mesg, VALUE recv, VALUE method)
VALUE | rb_name_err_new (VALUE mesg, VALUE recv, VALUE method)
static VALUE | name_err_name (VALUE self)
static VALUE | name_err_local_variables (VALUE self)
static VALUE | nometh_err_init_attr (VALUE exc, VALUE args, int priv)
static VALUE | nometh_err_initialize (int argc, VALUE *argv, VALUE self)
VALUE | rb_nomethod_err_new (VALUE mesg, VALUE recv, VALUE method, VALUE args, int priv)
static void | name_err_mesg_mark (void *p)
static size_t | name_err_mesg_memsize (const void *p)
static VALUE | rb_name_err_mesg_init (VALUE klass, VALUE mesg, VALUE recv, VALUE method)
static VALUE | name_err_mesg_alloc (VALUE klass)
static VALUE | name_err_mesg_init_copy (VALUE obj1, VALUE obj2)
static VALUE | name_err_mesg_equal (VALUE obj1, VALUE obj2)
static VALUE | name_err_mesg_receiver_name (VALUE obj)
static VALUE | name_err_mesg_to_str (VALUE obj)
static VALUE | name_err_mesg_dump (VALUE obj, VALUE limit)
static VALUE | name_err_mesg_load (VALUE klass, VALUE str)
static VALUE | name_err_receiver (VALUE self)
static VALUE | nometh_err_args (VALUE self)
static VALUE | nometh_err_private_call_p (VALUE self)
void | rb_invalid_str (const char *str, const char *type)
| Honestly I don't understand the name, but it raises an instance of rb_eArgError.
static VALUE | key_err_receiver (VALUE self)
static VALUE | key_err_key (VALUE self)
VALUE | rb_key_err_new (VALUE mesg, VALUE recv, VALUE key)
static VALUE | key_err_initialize (int argc, VALUE *argv, VALUE self)
static VALUE | no_matching_pattern_key_err_matchee (VALUE self)
static VALUE | no_matching_pattern_key_err_key (VALUE self)
static VALUE | no_matching_pattern_key_err_initialize (int argc, VALUE *argv, VALUE self)
static VALUE | syntax_error_initialize (int argc, VALUE *argv, VALUE self)
static VALUE | set_syserr (int n, const char *name)
static VALUE | get_syserr (int n)
static VALUE | syserr_initialize (int argc, VALUE *argv, VALUE self)
static VALUE | syserr_errno (VALUE self)
static VALUE | syserr_eqq (VALUE self, VALUE exc)
static VALUE | exception_alloc (VALUE klass)
static VALUE | exception_dumper (VALUE exc)
static int | ivar_copy_i (st_data_t key, st_data_t val, st_data_t exc)
void | rb_exc_check_circular_cause (VALUE exc)
static VALUE | exception_loader (VALUE exc, VALUE obj)
void | Init_Exception (void)
void | rb_enc_raise (rb_encoding *enc, VALUE exc, const char *fmt,...)
| Identical to rb_raise(), except it additionally takes an encoding.
void | rb_vraise (VALUE exc, const char *fmt, va_list ap)
void | rb_raise (VALUE exc, const char *fmt,...)
| Exception entry point.
static void | raise_loaderror (VALUE path, VALUE mesg)
void | rb_loaderror (const char *fmt,...)
| Raises an instance of rb_eLoadError.
void | rb_loaderror_with_path (VALUE path, const char *fmt,...)
| Identical to rb_loaderror(), except it additionally takes which file is unable to load.
void | rb_notimplement (void)
void | rb_fatal (const char *fmt,...)
| Raises the unsung "fatal" exception.
static VALUE | make_errno_exc (const char *mesg)
static VALUE | make_errno_exc_str (VALUE mesg)
VALUE | rb_syserr_new (int err, const char *msg)
| Creates an exception object that represents the given C errno.
VALUE | rb_syserr_new_str (int n, VALUE arg)
| Identical to rb_syserr_new(), except it takes the message in Ruby's String instead of C's.
void | rb_syserr_fail (int err, const char *msg)
| Raises appropriate exception that represents a C errno.
void | rb_syserr_fail_str (int err, VALUE msg)
| Identical to rb_syserr_fail(), except it takes the message in Ruby's String instead of C's.
void | rb_sys_fail (const char *msg)
| Converts a C errno into a Ruby exception, then raises it.
void | rb_sys_fail_str (VALUE msg)
| Identical to rb_sys_fail(), except it takes the message in Ruby's String instead of C's.
static void | rb_mod_exc_raise (VALUE exc, VALUE mod)
void | rb_mod_sys_fail (VALUE mod, const char *msg)
| Identical to rb_sys_fail(), except it takes additional module to extend the exception object before raising.
void | rb_mod_sys_fail_str (VALUE mod, VALUE msg)
| Identical to rb_mod_sys_fail(), except it takes the message in Ruby's String instead of C's.
void | rb_mod_syserr_fail (VALUE mod, int err, const char *msg)
| Identical to rb_mod_sys_fail(), except it does not depend on C global variable errno.
void | rb_mod_syserr_fail_str (VALUE mod, int err, VALUE msg)
| Identical to rb_mod_syserr_fail(), except it takes the message in Ruby's String instead of C's.
static void | syserr_warning (VALUE mesg, int err)
void | rb_sys_warning (const char *fmt,...)
| Identical to rb_sys_fail(), except it does not raise an exception to render a warning instead.
void | rb_sys_enc_warning (rb_encoding *enc, const char *fmt,...)
void | rb_syserr_enc_warning (int err, rb_encoding *enc, const char *fmt,...)
void | rb_load_fail (VALUE path, const char *err)
void | rb_error_frozen (const char *what)
| Identical to rb_frozen_error_raise(), except its raising exception has a message like "can't modify frozen /what/".
void | rb_frozen_error_raise (VALUE frozen_obj, const char *fmt,...)
| Raises an instance of rb_eFrozenError.
static VALUE | inspect_frozen_obj (VALUE obj, VALUE mesg, int recur)
void | rb_error_frozen_object (VALUE frozen_obj)
| Identical to rb_error_frozen(), except it takes arbitrary Ruby object instead of C's string.
void | rb_check_frozen (VALUE obj)
| Queries if the passed object is frozen.
void | rb_check_copyable (VALUE obj, VALUE orig)
| Ensures that the passed object can be `initialize_copy` relationship.
void | Init_syserr (void)
void | rb_exc_raise (VALUE mesg)
| Raises an exception in the current thread.
void | rb_exc_fatal (VALUE mesg)
| Raises a fatal error in the current thread.
VALUE | rb_errinfo (void)
| This is the same as `$!` in Ruby.
void | rb_set_errinfo (VALUE err)
| Sets the current exception (`$!`) to the given value.
void | rb_readwrite_sys_fail (enum rb_io_wait_readwrite waiting, const char *msg)
| Raises appropriate exception using the parameters.
void | rb_iter_break (void)
| Breaks from a block.
void | rb_iter_break_value (VALUE val)
| Identical to rb_iter_break(), except it additionally takes the "value" of this breakage.
void | rb_exit (int status)
| Terminates the current execution context.
void | rb_readwrite_syserr_fail (enum rb_io_wait_readwrite waiting, int err, const char *msg)
| Identical to rb_readwrite_sys_fail(), except it does not depend on C global variable errno.
VALUE | rb_rescue (VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*r_proc)(VALUE, VALUE), VALUE data2)
| Identical to rb_rescue2(), except it does not take a list of exception classes.
VALUE | rb_rescue2 (VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*r_proc)(VALUE, VALUE), VALUE data2,...)
| An equivalent of `rescue` clause.
VALUE | rb_vrescue2 (VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*r_proc)(VALUE, VALUE), VALUE data2, va_list ap)
| Identical to rb_rescue2(), except it takes `va_list` instead of variadic number of arguments.
VALUE | rb_ensure (VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*e_proc)(VALUE), VALUE data2)
| An equivalent to `ensure` clause.

## Variables
long | rb_backtrace_length_limit = -1
VALUE | rb_eEAGAIN
VALUE | rb_eEWOULDBLOCK
VALUE | rb_eEINPROGRESS
static VALUE | rb_mWarning
static VALUE | rb_cWarningBuffer
static ID | id_warn
static ID | id_category
static ID | id_deprecated
static ID | id_experimental
static VALUE | sym_category
static VALUE | sym_highlight
struct { |
st_table * id2enum |
st_table * enum2id |
} | warning_categories |
const char * | rb_dynamic_description
static unsigned int | warning_disabled_categories
static struct bug_reporters | bug_reporters [MAX_BUG_REPORTERS]
static int | bug_reporters_size
static const char | builtin_types [][10]
VALUE | rb_eException
| Mother of all exceptions.
VALUE | rb_eSystemExit
| `SystemExit` exception.
VALUE | rb_eInterrupt
| `Interrupt` exception.
VALUE | rb_eSignal
| `SignalException` exception.
VALUE | rb_eFatal
| `fatal` exception.
VALUE | rb_eStandardError
| `StandardError` exception.
VALUE | rb_eRuntimeError
| `RuntimeError` exception.
VALUE | rb_eFrozenError
| `FrozenError` exception.
VALUE | rb_eTypeError
| `TypeError` exception.
VALUE | rb_eArgError
| `ArgumentError` exception.
VALUE | rb_eIndexError
| `IndexError` exception.
VALUE | rb_eKeyError
| `KeyError` exception.
VALUE | rb_eRangeError
| `RangeError` exception.
VALUE | rb_eNameError
| `NameError` exception.
VALUE | rb_eEncodingError
| `EncodingError` exception.
VALUE | rb_eEncCompatError
| `Encoding::CompatibilityError` exception.
VALUE | rb_eNoMethodError
| `NoMethodError` exception.
VALUE | rb_eSecurityError
| `SecurityError` exception.
VALUE | rb_eNotImpError
| `NotImplementedError` exception.
VALUE | rb_eNoMemError
| `NoMemoryError` exception.
VALUE | rb_cNameErrorMesg
| `NameError::Message` class.
VALUE | rb_eNoMatchingPatternError
| `NoMatchingPatternError` exception.
VALUE | rb_eNoMatchingPatternKeyError
| `NoMatchingPatternKeyError` exception.
VALUE | rb_eScriptError
| `ScriptError` exception.
VALUE | rb_eSyntaxError
| `SyntaxError` exception.
VALUE | rb_eLoadError
| `LoadError` exception.
VALUE | rb_eSystemCallError
| `SystemCallError` exception.
VALUE | rb_mErrno
| `Errno` module.
static VALUE | rb_eNOERROR
ID | ruby_static_id_cause
static ID | id_message
static ID | id_detailed_message
static ID | id_backtrace
static ID | id_key
static ID | id_matchee
static ID | id_args
static ID | id_Errno
static ID | id_errno
static ID | id_i_path
static ID | id_receiver
static ID | id_recv
static ID | id_iseq
static ID | id_local_variables
static ID | id_private_call_p
static ID | id_top
static ID | id_bottom
static const rb_data_type_t | name_err_mesg_data_type
static st_table * | syserr_tbl
VALUE | rb_eException
| Mother of all exceptions.
VALUE | rb_eStandardError
| `StandardError` exception.
VALUE | rb_eSystemExit
| `SystemExit` exception.
VALUE | rb_eInterrupt
| `Interrupt` exception.
VALUE | rb_eSignal
| `SignalException` exception.
VALUE | rb_eFatal
| `fatal` exception.
VALUE | rb_eArgError
| `ArgumentError` exception.
VALUE | rb_eEOFError
| `EOFError` exception.
VALUE | rb_eIndexError
| `IndexError` exception.
VALUE | rb_eStopIteration
| `StopIteration` exception.
VALUE | rb_eKeyError
| `KeyError` exception.
VALUE | rb_eRangeError
| `RangeError` exception.
VALUE | rb_eIOError
| `IOError` exception.
VALUE | rb_eRuntimeError
| `RuntimeError` exception.
VALUE | rb_eFrozenError
| `FrozenError` exception.
VALUE | rb_eSecurityError
| `SecurityError` exception.
VALUE | rb_eSystemCallError
| `SystemCallError` exception.
VALUE | rb_eThreadError
| `ThreadError` exception.
VALUE | rb_eTypeError
| `TypeError` exception.
VALUE | rb_eZeroDivError
| `ZeroDivisionError` exception.
VALUE | rb_eNotImpError
| `NotImplementedError` exception.
VALUE | rb_eNoMemError
| `NoMemoryError` exception.
VALUE | rb_eNoMethodError
| `NoMethodError` exception.
VALUE | rb_eFloatDomainError
| `FloatDomainError` exception.
VALUE | rb_eLocalJumpError
| `LocalJumpError` exception.
VALUE | rb_eSysStackError
| `SystemStackError` exception.
VALUE | rb_eRegexpError
| `RegexpError` exception.
VALUE | rb_eEncodingError
| `EncodingError` exception.
VALUE | rb_eEncCompatError
| `Encoding::CompatibilityError` exception.
VALUE | rb_eNoMatchingPatternError
| `NoMatchingPatternError` exception.
VALUE | rb_eNoMatchingPatternKeyError
| `NoMatchingPatternKeyError` exception.
VALUE | rb_eScriptError
| `ScriptError` exception.
VALUE | rb_eNameError
| `NameError` exception.
VALUE | rb_eSyntaxError
| `SyntaxError` exception.
VALUE | rb_eLoadError
| `LoadError` exception.
VALUE | rb_eMathDomainError
| `Math::DomainError` exception.

## Detailed Description

## Macro Definition Documentation

## ◆ bug_report_begin

#define bug_report_begin | ( |  | out,
|  |  | fmt )

Value:
do { \
va_list args; \
va_start(args, fmt); \
bug_report_begin_valist(out, fmt, args); \
va_end(args); \
} while (0)

Definition at line 729 of file error.c.

## ◆ EXIT_SUCCESS

#define EXIT_SUCCESS 0

Definition at line 54 of file error.c.

## ◆ frozen_err_receiver

#define frozen_err_receiver name_err_receiver

Definition at line 1781 of file error.c.

## ◆ id_bt

#define id_bt idBt

Definition at line 1121 of file error.c.

## ◆ id_bt_locations

#define id_bt_locations idBt_locations

Definition at line 1122 of file error.c.

## ◆ id_cause

#define id_cause ruby_static_id_cause

Definition at line 1116 of file error.c.

## ◆ id_mesg

#define id_mesg idMesg

Definition at line 1123 of file error.c.

## ◆ id_name

#define id_name idName

Definition at line 1124 of file error.c.

## ◆ MAX_BUG_REPORTERS

#define MAX_BUG_REPORTERS 0x100

Definition at line 596 of file error.c.

## ◆ name_err_mesg_free

#define name_err_mesg_free RUBY_TYPED_DEFAULT_FREE

Definition at line 1968 of file error.c.

## ◆ report_bug

#define report_bug | ( |  | file,
|  |  | line,
|  |  | fmt,
|  |  | ctx )

Value:
do { \
FILE *out = bug_report_file(file, line); \
if (out) { \
bug_report_begin(out, fmt); \
rb_vm_bugreport(ctx); \
bug_report_end(out); \
} \
} while (0) \
__sFILE
Definition vsnprintf.c:160

Definition at line 750 of file error.c.

## ◆ REPORT_BUG_BUFSIZ

#define REPORT_BUG_BUFSIZ 256

Definition at line 620 of file error.c.

## ◆ report_bug_valist

#define report_bug_valist | ( |  | file,
|  |  | line,
|  |  | fmt,
|  |  | ctx,
|  |  | args )

Value:
do { \
FILE *out = bug_report_file(file, line); \
if (out) { \
bug_report_begin_valist(out, fmt, args); \
rb_vm_bugreport(ctx); \
bug_report_end(out); \
} \
} while (0) \

Definition at line 759 of file error.c.

## ◆ ruby_debug

#define ruby_debug (*rb_ruby_debug_ptr())

This variable controls whether the interpreter is in debug mode.

Setting this to some truthy value is equivalent to passing `-d` flag to the interpreter.

Return values

  Qnil | Interpreter not in debug mode.
  Qfalse | Interpreter not in debug mode.
  otherwise | Interpreter is in debug mode.

Definition at line 470 of file error.h.

Referenced by rb_str_format(), and ruby_init().

## ◆ ruby_verbose

#define ruby_verbose (*rb_ruby_verbose_ptr())

This variable controls whether the interpreter is in debug mode.

Setting this to some truthy value is equivalent to passing `-W` flag to the interpreter. Setting this to Qfalse is equivalent to passing `-W1` flag to the interpreter. Setting this to Qnil is equivalent to passing `-W0` flag to the interpreter.

Return values

  Qnil | Interpreter is quiet.
  Qfalse | Interpreter is kind of chatty.
  otherwise | Interpreter is very verbose.

Definition at line 459 of file error.h.

Referenced by rb_category_compile_warn(), rb_category_warn(), rb_category_warning(), rb_compile_warn(), rb_compile_warning(), rb_io_extract_encoding_option(), rb_str_format(), rb_sys_warning(), rb_warn(), and rb_warning().

## ◆ UNDEF_LEAKED

#define UNDEF_LEAKED "undef leaked to the Ruby space"

Definition at line 974 of file error.c.

## ◆ WEXITSTATUS

#define WEXITSTATUS | ( |  | status | ) |

Value:
(status)

Definition at line 62 of file error.c.

## ◆ WIFEXITED

#define WIFEXITED | ( |  | status | ) |

Value:
1

Definition at line 58 of file error.c.

## ◆ with_warn_vsprintf

#define with_warn_vsprintf | ( |  | file,
|  |  | line,
|  |  | fmt )

Value:
VALUE str; \
va_list args; \
va_start(args, fmt); \
str = warn_vsprintf(NULL, file, line, fmt, args); \
va_end(args);
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40

Definition at line 355 of file error.c.

## ◆ with_warning_string

#define with_warning_string | ( |  | mesg,
|  |  | enc,
|  |  | fmt )

Value:
with_warning_string_from(mesg, enc, fmt, fmt)

Definition at line 402 of file error.c.

## ◆ with_warning_string_from

#define with_warning_string_from | ( |  | mesg,
|  |  | enc,
|  |  | fmt,
|  |  | last_arg )

Value:
VALUE mesg; \
va_list args; va_start(args, last_arg); \
mesg = warning_string(enc, fmt, args); \
va_end(args);

Definition at line 404 of file error.c.

## ◆ WRITE_CONST

#define WRITE_CONST | ( |  | fd,
|  |  | str )

Value:
write_or_abort((fd),(str),sizeof(str) - 1)

Definition at line 840 of file error.c.

## ◆ write_or_abort

#define write_or_abort | ( |  | fd,
|  |  | str,
|  |  | len )

Value:
(write((fd), (str), (len)) < 0 ? abort() : (void)0)

Definition at line 839 of file error.c.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Definition at line 1954 of file error.c.

## ◆ rb_io_wait_readwrite

enum rb_io_wait_readwrite

for rb_readwrite_sys_fail first argument

Definition at line 57 of file error.h.

## ◆ rb_warning_category_t

enum rb_warning_category_t

Warning categories.

A warning issued using this API can be selectively requested / suppressed by the end-users. For instance passing `-W:no-deprecated` to the ruby process would suppress those warnings in deprecated category.

Warning
  There is no way to declare a new category (for now).

Enumerator
RB_WARN_CATEGORY_NONE | Category unspecified.
RB_WARN_CATEGORY_DEPRECATED | Warning is for deprecated features.
RB_WARN_CATEGORY_EXPERIMENTAL | Warning is for experimental features.

Definition at line 43 of file error.h.

## Function Documentation

## ◆ bug_important_message()

static void bug_important_message | ( | FILE * | out,
|  | const char *const | msg,
|  | size_t | len )
| static

Definition at line 639 of file error.c.

## ◆ bug_report_begin_valist()

static void bug_report_begin_valist | ( | FILE * | out,
|  | const char * | fmt,
|  | va_list | args )
| static

Definition at line 717 of file error.c.

## ◆ bug_report_end()

static void bug_report_end | ( | FILE * | out | ) |
| static

Definition at line 737 of file error.c.

## ◆ bug_report_file()

static FILE * bug_report_file | ( | const char * | file,
|  | int | line )
| static

Definition at line 622 of file error.c.

## ◆ builtin_class_name()

static const char * builtin_class_name | ( | VALUE | x | ) |
| static

Definition at line 937 of file error.c.

## ◆ check_highlight_keyword()

static VALUE check_highlight_keyword | ( | VALUE | opt,
|  | int | auto_tty_detect )
| static

Definition at line 1258 of file error.c.

## ◆ check_order_keyword()

static VALUE check_order_keyword | ( | VALUE | opt | ) |
| static

Definition at line 1281 of file error.c.

## ◆ deprecation_warning_enabled()

static bool deprecation_warning_enabled | ( | void |  | ) |
| static

Definition at line 483 of file error.c.

## ◆ die()

static void die | ( | void |  | ) |
| static

Definition at line 770 of file error.c.

## ◆ displaying_class_of()

static VALUE displaying_class_of | ( | VALUE | x | ) |
| static

Definition at line 926 of file error.c.

## ◆ end_with_asciichar()

static int end_with_asciichar | ( | VALUE | str,
|  | int | c )
| inlinestatic

Definition at line 524 of file error.c.

## ◆ err_init_recv()

static VALUE err_init_recv | ( | VALUE | exc,
|  | VALUE | recv )
| static

Definition at line 1741 of file error.c.

## ◆ err_position_0()

static int err_position_0 | ( | char * | buf,
|  | long | len,
|  | const char * | file,
|  | int | line )
| static

Definition at line 100 of file error.c.

## ◆ err_vcatf()

static VALUE err_vcatf | ( | VALUE | str,
|  | const char * | pre,
|  | const char * | file,
|  | int | line,
|  | const char * | fmt,
|  | va_list | args )
| static

Definition at line 115 of file error.c.

## ◆ exc_backtrace()

static VALUE exc_backtrace | ( | VALUE | exc | ) |
| static

Definition at line 1488 of file error.c.

## ◆ exc_backtrace_locations()

static VALUE exc_backtrace_locations | ( | VALUE | exc | ) |
| static

Definition at line 1536 of file error.c.

## ◆ exc_cause()

static VALUE exc_cause | ( | VALUE | exc | ) |
| static

Definition at line 1601 of file error.c.

## ◆ exc_detailed_message()

static VALUE exc_detailed_message | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | exc )
| static

Definition at line 1404 of file error.c.

## ◆ exc_equal()

static VALUE exc_equal | ( | VALUE | exc,
|  | VALUE | obj )
| static

Definition at line 1622 of file error.c.

## ◆ exc_exception()

static VALUE exc_exception | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self )
| static

Definition at line 1189 of file error.c.

## ◆ exc_full_message()

static VALUE exc_full_message | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | exc )
| static

Definition at line 1326 of file error.c.

## ◆ exc_init()

static VALUE exc_init | ( | VALUE | exc,
|  | VALUE | mesg )
| static

Definition at line 1149 of file error.c.

## ◆ exc_initialize()

static VALUE exc_initialize | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | exc )
| static

Definition at line 1167 of file error.c.

## ◆ exc_inspect()

static VALUE exc_inspect | ( | VALUE | exc | ) |
| static

Definition at line 1425 of file error.c.

## ◆ exc_message()

static VALUE exc_message | ( | VALUE | exc | ) |
| static

Definition at line 1358 of file error.c.

## ◆ exc_s_to_tty_p()

static VALUE exc_s_to_tty_p | ( | VALUE | self | ) |
| static

Definition at line 1252 of file error.c.

## ◆ exc_set_backtrace()

static VALUE exc_set_backtrace | ( | VALUE | exc,
|  | VALUE | bt )
| static

Definition at line 1580 of file error.c.

## ◆ exc_to_s()

static VALUE exc_to_s | ( | VALUE | exc | ) |
| static

Definition at line 1210 of file error.c.

## ◆ exception_alloc()

static VALUE exception_alloc | ( | VALUE | klass | ) |
| static

Definition at line 2942 of file error.c.

## ◆ exception_dumper()

static VALUE exception_dumper | ( | VALUE | exc | ) |
| static

Definition at line 2948 of file error.c.

## ◆ exception_loader()

static VALUE exception_loader | ( | VALUE | exc,
|  | VALUE | obj )
| static

Definition at line 2967 of file error.c.

## ◆ exit_initialize()

static VALUE exit_initialize | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | exc )
| static

Definition at line 1665 of file error.c.

## ◆ exit_status()

static VALUE exit_status | ( | VALUE | exc | ) |
| static

Definition at line 1715 of file error.c.

## ◆ exit_success_p()

static VALUE exit_success_p | ( | VALUE | exc | ) |
| static

Definition at line 1729 of file error.c.

## ◆ frozen_err_initialize()

static VALUE frozen_err_initialize | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self )
| static

Definition at line 1760 of file error.c.

## ◆ get_syserr()

static VALUE get_syserr | ( | int | n | ) |
| static

Definition at line 2438 of file error.c.

## ◆ Init_Exception()

void Init_Exception | ( | void |  | ) |

Definition at line 2990 of file error.c.

## ◆ Init_syserr()

void Init_syserr | ( | void |  | ) |

Definition at line 3534 of file error.c.

## ◆ inspect_frozen_obj()

static VALUE inspect_frozen_obj | ( | VALUE | obj,
|  | VALUE | mesg,
|  | int | recur )
| static

Definition at line 3486 of file error.c.

## ◆ ivar_copy_i()

static int ivar_copy_i | ( | st_data_t | key,
|  | st_data_t | val,
|  | st_data_t | exc )
| static

Definition at line 2958 of file error.c.

## ◆ key_err_initialize()

static VALUE key_err_initialize | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self )
| static

Definition at line 2243 of file error.c.

## ◆ key_err_key()

static VALUE key_err_key | ( | VALUE | self | ) |
| static

Definition at line 2214 of file error.c.

## ◆ key_err_receiver()

static VALUE key_err_receiver | ( | VALUE | self | ) |
| static

Definition at line 2197 of file error.c.

## ◆ make_errno_exc()

static VALUE make_errno_exc | ( | const char * | mesg | ) |
| static

Definition at line 3222 of file error.c.

## ◆ make_errno_exc_str()

static VALUE make_errno_exc_str | ( | VALUE | mesg | ) |
| static

Definition at line 3234 of file error.c.

## ◆ name_err_init()

static VALUE name_err_init | ( | VALUE | exc,
|  | VALUE | mesg,
|  | VALUE | recv,
|  | VALUE | method )
| static

Definition at line 1858 of file error.c.

## ◆ name_err_init_attr()

static VALUE name_err_init_attr | ( | VALUE | exc,
|  | VALUE | recv,
|  | VALUE | method )
| static

Definition at line 1814 of file error.c.

## ◆ name_err_initialize()

static VALUE name_err_initialize | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self )
| static

Definition at line 1841 of file error.c.

## ◆ name_err_local_variables()

static VALUE name_err_local_variables | ( | VALUE | self | ) |
| static

Definition at line 1895 of file error.c.

## ◆ name_err_mesg_alloc()

static VALUE name_err_mesg_alloc | ( | VALUE | klass | ) |
| static

Definition at line 2009 of file error.c.

## ◆ name_err_mesg_dump()

static VALUE name_err_mesg_dump | ( | VALUE | obj,
|  | VALUE | limit )
| static

Definition at line 2119 of file error.c.

## ◆ name_err_mesg_equal()

static VALUE name_err_mesg_equal | ( | VALUE | obj1,
|  | VALUE | obj2 )
| static

Definition at line 2031 of file error.c.

## ◆ name_err_mesg_init_copy()

static VALUE name_err_mesg_init_copy | ( | VALUE | obj1,
|  | VALUE | obj2 )
| static

Definition at line 2016 of file error.c.

## ◆ name_err_mesg_load()

static VALUE name_err_mesg_load | ( | VALUE | klass,
|  | VALUE | str )
| static

Definition at line 2126 of file error.c.

## ◆ name_err_mesg_mark()

static void name_err_mesg_mark | ( | void * | p | ) |
| static

Definition at line 1962 of file error.c.

## ◆ name_err_mesg_memsize()

static size_t name_err_mesg_memsize | ( | const void * | p | ) |
| static

Definition at line 1971 of file error.c.

## ◆ name_err_mesg_receiver_name()

static VALUE name_err_mesg_receiver_name | ( | VALUE | obj | ) |
| static

Definition at line 2051 of file error.c.

## ◆ name_err_mesg_to_str()

static VALUE name_err_mesg_to_str | ( | VALUE | obj | ) |
| static

Definition at line 2062 of file error.c.

## ◆ name_err_name()

static VALUE name_err_name | ( | VALUE | self | ) |
| static

Definition at line 1879 of file error.c.

## ◆ name_err_receiver()

static VALUE name_err_receiver | ( | VALUE | self | ) |
| static

Definition at line 2139 of file error.c.

## ◆ no_matching_pattern_key_err_initialize()

static VALUE no_matching_pattern_key_err_initialize | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self )
| static

Definition at line 2309 of file error.c.

## ◆ no_matching_pattern_key_err_key()

static VALUE no_matching_pattern_key_err_key | ( | VALUE | self | ) |
| static

Definition at line 2291 of file error.c.

## ◆ no_matching_pattern_key_err_matchee()

static VALUE no_matching_pattern_key_err_matchee | ( | VALUE | self | ) |
| static

Definition at line 2274 of file error.c.

## ◆ nometh_err_args()

static VALUE nometh_err_args | ( | VALUE | self | ) |
| static

Definition at line 2163 of file error.c.

## ◆ nometh_err_init_attr()

static VALUE nometh_err_init_attr | ( | VALUE | exc,
|  | VALUE | args,
|  | int | priv )
| static

Definition at line 1909 of file error.c.

## ◆ nometh_err_initialize()

static VALUE nometh_err_initialize | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self )
| static

Definition at line 1933 of file error.c.

## ◆ nometh_err_private_call_p()

static VALUE nometh_err_private_call_p | ( | VALUE | self | ) |
| static

Definition at line 2176 of file error.c.

## ◆ postscript_dump()

static void postscript_dump | ( | FILE * | out | ) |
| static

Definition at line 694 of file error.c.

## ◆ preface_dump()

static void preface_dump | ( | FILE * | out | ) |
| static

Definition at line 669 of file error.c.

## ◆ raise_loaderror()

static void raise_loaderror | ( | VALUE | path,
|  | VALUE | mesg )
| static

Definition at line 3161 of file error.c.

## ◆ rb_assert_failure()

void rb_assert_failure | ( | const char * | file,
|  | int | line,
|  | const char * | name,
|  | const char * | expr )

Definition at line 871 of file error.c.

## ◆ rb_async_bug_errno()

void rb_async_bug_errno | ( | const char * | mesg,
|  | int | errno_arg )

Definition at line 843 of file error.c.

## ◆ rb_bug()

void rb_bug | ( | const char * | fmt,
|  |  | ... )

Interpreter panic switch.

Immediate process termination without any synchronisations shall occur. LOTS of internal states, stack traces, and even machine registers are displayed if possible for debugging purposes then.

Warning
  Do not use this API.
  You are not expected to use this API.
  Why not just fix your code instead of calling this API?
  It was a bad idea to expose this API to extension libraries at the first place. We just cannot delete it at this point for backwards compatibility. That doesn't mean everyone are welcomed to call this function at will.

Parameters

  [in] | fmt | Format specifier string compatible with rb_sprintf().

Note
  It never returns.

Definition at line 794 of file error.c.

Referenced by rb_bug_errno(), rb_check_type(), rb_econv_open_opts(), rb_fix2str(), rb_gc_writebarrier(), rb_mod_init_copy(), rb_obj_freeze(), rb_postponed_job_register(), rb_postponed_job_register_one(), rb_readwrite_syserr_fail(), rb_str_set_len(), rb_thread_call_with_gvl(), rb_tracearg_object(), rb_tracearg_raised_exception(), rb_tracearg_return_value(), rb_unexpected_type(), and rb_update_max_fd().

## ◆ rb_bug_errno()

void rb_bug_errno | ( | const char * | msg,
|  | int | err )

This is a wrapper of rb_bug() which automatically constructs appropriate message from the passed errno.

Parameters

  [in] | msg | Additional message to display.

Exceptions

  err | C level errno.

Note
  It never returns.

Definition at line 822 of file error.c.

## ◆ rb_bug_for_fatal_signal()

void rb_bug_for_fatal_signal | ( | ruby_sighandler_t | default_sighandler,
|  | int | sig,
|  | const void * | ctx,
|  | const char * | fmt,
|  |  | ... )

Definition at line 804 of file error.c.

## ◆ rb_bug_reporter_add()

int rb_bug_reporter_add | ( | void(* | func )(FILE *, void *),
|  | void * | data )

Definition at line 606 of file error.c.

## ◆ rb_bug_without_die()

void rb_bug_without_die | ( | const char * | fmt,
|  | va_list | args )

Definition at line 781 of file error.c.

## ◆ rb_builtin_class_name()

const char * rb_builtin_class_name | ( | VALUE | x | ) |

Definition at line 963 of file error.c.

## ◆ rb_builtin_type_name()

const char * rb_builtin_type_name | ( | int | t | ) |

Definition at line 916 of file error.c.

## ◆ rb_category_compile_warn()

void rb_category_compile_warn | ( | rb_warning_category_t | cat,
|  | const char * | file,
|  | int | line,
|  | const char * | fmt,
|  |  | ... )

Identical to rb_compile_warn(), except it also accepts category.

Parameters

  [in] | cat | Category e.g. deprecated.
  [in] | file | The path corresponding to Ruby level `__FILE__`.
  [in] | line | The number corresponding to Ruby level `__LINE__`.
  [in] | fmt | Format specifier string compatible with rb_sprintf().

Definition at line 384 of file error.c.

## ◆ rb_category_warn()

void rb_category_warn | ( | rb_warning_category_t | cat,
|  | const char * | fmt,
|  |  | ... )

Identical to rb_category_warning(), except it reports always regardless of runtime `-W` flag.

Parameters

  [in] | cat | Category e.g. deprecated.
  [in] | fmt | Format specifier string compatible with rb_sprintf().

Definition at line 421 of file error.c.

Referenced by rb_io_print().

## ◆ rb_category_warning()

void rb_category_warning | ( | rb_warning_category_t | cat,
|  | const char * | fmt,
|  |  | ... )

Identical to rb_warning(), except it takes additional "category" parameter.

Parameters

  [in] | cat | Name of a known category.
  [in] | fmt | Format specifier string compatible with rb_sprintf().

Definition at line 453 of file error.c.

## ◆ rb_check_backtrace()

static VALUE rb_check_backtrace | ( | VALUE | bt | ) |
| static

Definition at line 1548 of file error.c.

## ◆ rb_check_copyable()

void rb_check_copyable | ( | VALUE | obj,
|  | VALUE | orig )

Ensures that the passed object can be `initialize_copy` relationship.

When you implement your own one you would better call this at the right beginning of your implementation.

Parameters

  [in] | obj | Destination object.
  [in] | orig | Source object.

Exceptions

  rb_eFrozenError | `obj` is frozen.

Postcondition
  Upon successful return obj is guaranteed safe to copy orig.

Definition at line 3526 of file error.c.

## ◆ rb_check_frozen()

void rb_check_frozen | ( | VALUE | obj | ) |

Queries if the passed object is frozen.

Parameters

  [in] | obj | Target object to test frozen-ness.

Exceptions

  rb_eFrozenError | It is frozen.

Postcondition
  Upon successful return it is guaranteed not frozen.

Definition at line 3520 of file error.c.

## ◆ rb_check_type()

void rb_check_type | ( | VALUE | obj,
|  | int | t )

This was the old implementation of Check_Type(), but they diverged.

This one remains for theoretical backwards compatibility. People normally need not use it.

Parameters

  [in] | obj | An object.
  [in] | t | A type.

Exceptions

  rb_eTypeError | `obj` is not of type `t`.
  rb_eFatal | `obj` is corrupt.

Postcondition
  Upon successful return `obj` is guaranteed to have type `t`.

Definition at line 998 of file error.c.

## ◆ rb_check_typeddata()

void * rb_check_typeddata | ( | VALUE | obj,
|  | const rb_data_type_t * | data_type )

Identical to rb_typeddata_is_kind_of(), except it raises exceptions instead of returning false.

Parameters

  [in] | obj | An instance of RTypedData.
  [in] | data_type | Expected data type of `obj`.

Exceptions

  rb_eTypeError | obj is not of `data_type`.

Returns
  Unwrapped C struct that `obj` holds.

Postcondition
  Upon successful return `obj`'s type is guaranteed `data_type`.

Definition at line 1058 of file error.c.

Referenced by rb_waitpid().

## ◆ rb_compile_warn()

void rb_compile_warn | ( | const char * | file,
|  | int | line,
|  | const char * | fmt,
|  |  | ... )

Identical to rb_compile_warning(), except it reports always regardless of runtime `-W` flag.

Parameters

  [in] | file | The path corresponding to Ruby level `__FILE__`.
  [in] | line | The number corresponding to Ruby level `__LINE__`.
  [in] | fmt | Format specifier string compatible with rb_sprintf().

Definition at line 363 of file error.c.

## ◆ rb_compile_warning()

void rb_compile_warning | ( | const char * | file,
|  | int | line,
|  | const char * | fmt,
|  |  | ... )

Issues a compile-time warning that happens at `__file__:__line__`.

Purpose of this function being exposed to CAPI is unclear.

Note
  This function is affected by the `-W` flag.

Parameters

  [in] | file | The path corresponding to Ruby level `__FILE__`.
  [in] | line | The number corresponding to Ruby level `__LINE__`.
  [in] | fmt | Format specifier string compatible with rb_sprintf().

Definition at line 374 of file error.c.

## ◆ rb_ec_backtrace_location_ary()

VALUE rb_ec_backtrace_location_ary | ( | const rb_execution_context_t * | ec,
|  | long | lev,
|  | long | n,
|  | bool | skip_internal )

Definition at line 867 of file vm_backtrace.c.

## ◆ rb_enc_raise()

void rb_enc_raise | ( | rb_encoding * | enc,
|  | VALUE | exc,
|  | const char * | fmt,
|  |  | ... )

Identical to rb_raise(), except it additionally takes an encoding.

Parameters

  [in] | enc | Encoding of the generating exception.
  [in] | exc | A subclass of rb_eException.
  [in] | fmt | Format specifier string compatible with rb_sprintf().
  [in] | ... | Contents of the message.

Exceptions

  exc | The specified exception.

Note
  It never returns.

Definition at line 3131 of file error.c.

Referenced by rb_str_format().

## ◆ rb_enc_warn()

void rb_enc_warn | ( | rb_encoding * | enc,
|  | const char * | fmt,
|  |  | ... )

Definition at line 431 of file error.c.

## ◆ rb_ensure()

VALUE rb_ensure | ( | VALUE(* | b_proc )(VALUE),
|  | VALUE | data1,
|  | VALUE(* | e_proc )(VALUE),
|  | VALUE | data2 )

An equivalent to `ensure` clause.

Calls the function `b_proc` with `data1` as the argument, then calls `e_proc` with `data2` when execution terminated.

Parameters

  [in] | b_proc | A function representing begin clause.
  [in,out] | data1 | Passed to `b_proc`.
  [in] | e_proc | A function representing ensure clause.
  [in,out] | data2 | Passed to `e_proc`.

Return values

  RUBY_Qnil | exception occurred inside of `b_proc`.
  otherwise | The return value of `b_proc`.

See also
  rb_rescue
  rb_rescue2
  rb_protect

Definition at line 997 of file eval.c.

Referenced by rb_mutex_sleep(), and rb_mutex_synchronize().

## ◆ rb_errinfo()

VALUE rb_errinfo | ( | void |  | ) |

This is the same as `$!` in Ruby.

Return values

  RUBY_Qnil | Not handling exceptions at the moment.
  otherwise | The current exception in the current thread.

Definition at line 1878 of file eval.c.

## ◆ rb_error_frozen()

void rb_error_frozen | ( | const char * | what | ) |

Identical to rb_frozen_error_raise(), except its raising exception has a message like "can't modify frozen /what/".

Parameters

  [in] | what | What was frozen.

Exceptions

  rb_eFrozenError | Always raises this.

Note
  It never returns.

Definition at line 3466 of file error.c.

## ◆ rb_error_frozen_object()

void rb_error_frozen_object | ( | VALUE | what | ) |

Identical to rb_error_frozen(), except it takes arbitrary Ruby object instead of C's string.

Parameters

  [in] | what | What was frozen.

Exceptions

  rb_eFrozenError | Always raises this.

Note
  It never returns.

Definition at line 3498 of file error.c.

Referenced by rb_check_frozen_inline().

## ◆ rb_error_write()

void rb_error_write | ( | VALUE | errinfo,
|  | VALUE | emesg,
|  | VALUE | errat,
|  | VALUE | str,
|  | VALUE | opt,
|  | VALUE | highlight,
|  | VALUE | reverse )

Definition at line 305 of file eval_error.c.

## ◆ rb_exc_check_circular_cause()

void rb_exc_check_circular_cause | ( | VALUE | exc | ) |

Definition at line 294 of file eval_error.c.

## ◆ rb_exc_fatal()

void rb_exc_fatal | ( | VALUE | mesg | ) |

Raises a fatal error in the current thread.

Identical to rb_fatal(), except it raises the passed exception instance as- is instead of creating new one.

Same as rb_exc_raise() but raises a fatal error, which Ruby codes cannot rescue.

Definition at line 701 of file eval.c.

Referenced by rb_fatal().

## ◆ rb_exc_new()

VALUE rb_exc_new | ( | VALUE | etype,
|  | const char * | ptr,
|  | long | len )

Creates an instance of the passed exception class.

Parameters

  [in] | etype | A subclass of rb_eException.
  [in] | ptr | Buffer contains error message.
  [in] | len | Length of `ptr`, in bytes, not including the terminating NUL character.

Exceptions

  rb_eTypeError | `etype` is not a class.
  rb_eArgError | `len` is negative.

Returns
  An instance of `etype`.

Precondition
  At least `len` bytes of continuous memory region shall be accessible via `ptr`.

Definition at line 1129 of file error.c.

Referenced by rb_exc_new_cstr(), and rb_interrupt().

## ◆ rb_exc_new_cstr()

VALUE rb_exc_new_cstr | ( | VALUE | etype,
|  | const char * | str )

Identical to rb_exc_new(), except it assumes the passed pointer is a pointer to a C string.

Parameters

  [in] | etype | A subclass of rb_eException.
  [in] | str | A C string (becomes an error message).

Exceptions

  rb_eTypeError | `etype` is not a class.

Returns
  An instance of `etype`.

Definition at line 1136 of file error.c.

## ◆ rb_exc_new_str()

VALUE rb_exc_new_str | ( | VALUE | etype,
|  | VALUE | str )

Identical to rb_exc_new_cstr(), except it takes a Ruby's string instead of C's.

Parameters

  [in] | etype | A subclass of rb_eException.
  [in] | str | An instance of rb_cString.

Exceptions

  rb_eTypeError | `etype` is not a class.

Returns
  An instance of `etype`.

Definition at line 1142 of file error.c.

Referenced by rb_error_frozen_object().

## ◆ rb_exc_raise()

void rb_exc_raise | ( | VALUE | mesg | ) |

Raises an exception in the current thread.

Identical to rb_raise(), except it raises the passed exception instance as- is instead of creating new one.

Parameters

  [in] | mesg | an Exception class or an `Exception` object.

Exceptions

  always | raises an instance of the given exception class or the given `Exception` object.

Definition at line 688 of file eval.c.

Referenced by rb_econv_check_error(), rb_enc_raise(), rb_error_frozen_object(), rb_exit(), rb_f_abort(), rb_frozen_error_raise(), rb_interrupt(), rb_name_error(), rb_name_error_str(), rb_readwrite_syserr_fail(), rb_sys_fail(), rb_sys_fail_str(), rb_syserr_fail(), rb_syserr_fail_str(), and rb_throw_obj().

## ◆ rb_exc_set_backtrace()

VALUE rb_exc_set_backtrace | ( | VALUE | exc,
|  | VALUE | bt )

Definition at line 1586 of file error.c.

## ◆ rb_exit()

void rb_exit | ( | int | status | ) |

Terminates the current execution context.

This API is the entry point of a "well-mannered" termination sequence. When called from an extension library, it raises rb_eSystemExit exception. Programs could rescue that exception. Can cancel process exit then. Otherwise, that exception results in a process termination with the status passed to this function.

Parameters

  [in] | status | Exit status, see also exit(3).

Exceptions

  rb_eSystemExit | Exception representing the exit status.

Note
  It never returns.

Definition at line 4519 of file process.c.

Referenced by rb_f_abort(), rb_f_exit(), and rb_thread_kill().

## ◆ rb_fatal()

void rb_fatal | ( | const char * | fmt,
|  |  | ... )

Raises the unsung "fatal" exception.

This is considered severe. Nobody can rescue the exception. Once raised, process termination is inevitable. However ensure clauses still run, so that resources are properly cleaned up.

Parameters

  [in] | fmt | Format specifier string compatible with rb_sprintf().

Exceptions

  rb_eFatal | An exception that you cannot rescue.

Note
  It never returns.

Definition at line 3201 of file error.c.

## ◆ rb_frozen_error_raise()

void rb_frozen_error_raise | ( | VALUE | recv,
|  | const char * | fmt,
|  |  | ... )

Raises an instance of rb_eFrozenError.

The object can be obtained later using `FrozenError#receiver` of the raising exception.

Parameters

  [in] | recv | What is frozen.
  [in] | fmt | Format specifier string compatible with rb_sprintf().

Exceptions

  rb_eFrozenError | Always raises this.

Note
  It never returns.

Definition at line 3472 of file error.c.

Referenced by rb_class_modify_check(), and rb_thread_local_aset().

## ◆ rb_get_backtrace()

VALUE rb_get_backtrace | ( | VALUE | exc | ) |

Definition at line 1505 of file error.c.

## ◆ rb_get_detailed_message()

VALUE rb_get_detailed_message | ( | VALUE | exc,
|  | VALUE | opt )

Definition at line 1231 of file error.c.

## ◆ rb_get_message()

VALUE rb_get_message | ( | VALUE | exc | ) |

Definition at line 1222 of file error.c.

## ◆ rb_invalid_str()

void rb_invalid_str | ( | const char * | str,
|  | const char * | type )

Honestly I don't understand the name, but it raises an instance of rb_eArgError.

Parameters

  [in] | str | A message.
  [in] | type | Another message.

Exceptions

  rb_eArgError | Always raises this.

Note
  It never returns.

Definition at line 2182 of file error.c.

Referenced by rb_cstr_to_inum().

## ◆ rb_iseqw_local_variables()

VALUE rb_iseqw_local_variables | ( | VALUE | iseqval | ) |

Definition at line 3694 of file iseq.c.

## ◆ rb_iseqw_new()

VALUE rb_iseqw_new | ( | const rb_iseq_t * | iseq | ) |

Definition at line 1360 of file iseq.c.

## ◆ rb_iter_break()

void rb_iter_break | ( | void |  | ) |

Breaks from a block.

Because you are using a CAPI this is not as intuitive as it sounds. In order for this function to properly work, make a rb_block_call_func_t function that calls it internally, and pass that function to rb_block_call().

Exceptions

  rb_eLocalJumpError | Called from outside of a block.

Note
  It never returns.

Definition at line 1901 of file vm.c.

## ◆ rb_iter_break_value()

void rb_iter_break_value | ( | VALUE | val | ) |

Identical to rb_iter_break(), except it additionally takes the "value" of this breakage.

It will be the evaluation result of the iterator. This is kind of complicated; you cannot see this as a "return from a block" behaviour. Take a look at this example:

def foo(q)
puts(w = yield(q))
puts(e = yield(w))
puts(r = yield(e))
puts(t = yield(r))
puts(y = yield(t))
return "howdy!"
end
x = foo(0) {|i|
if i > 2
break "hello!"
else
next i + 1
end
}
puts x

This script outputs 1, 2, 3, and hello. Note that the value passed to break becomes the return value of foo method, not the value of yield. This is confusing, but can be handy on occasions e.g. when you want to bring a local variable out of a block.

Parameters

  [in] | val | The value of the iterator.

Exceptions

  rb_eLocalJumpError | Called from outside of a block.

Note
  It never returns.

Definition at line 1907 of file vm.c.

## ◆ rb_key_err_new()

VALUE rb_key_err_new | ( | VALUE | mesg,
|  | VALUE | recv,
|  | VALUE | key )

Definition at line 2224 of file error.c.

## ◆ rb_load_fail()

void rb_load_fail | ( | VALUE | path,
|  | const char * | err )

Definition at line 3457 of file error.c.

## ◆ rb_loaderror()

void rb_loaderror | ( | const char * | fmt,
|  |  | ... )

Raises an instance of rb_eLoadError.

Parameters

  [in] | fmt | Format specifier string compatible with rb_sprintf().

Exceptions

  rb_eLoadError | Always raises this.

Note
  It never returns.

Definition at line 3169 of file error.c.

## ◆ rb_loaderror_with_path()

void rb_loaderror_with_path | ( | VALUE | path,
|  | const char * | fmt,
|  |  | ... )

Identical to rb_loaderror(), except it additionally takes which file is unable to load.

The path can be obtained later using `LoadError#path` of the raising exception.

Parameters

  [in] | path | What failed.
  [in] | fmt | Format specifier string compatible with rb_sprintf().

Exceptions

  rb_eLoadError | Always raises this.

Note
  It never returns.

Definition at line 3181 of file error.c.

## ◆ rb_mod_exc_raise()

static void rb_mod_exc_raise | ( | VALUE | exc,
|  | VALUE | mod )
| static

Definition at line 3322 of file error.c.

## ◆ rb_mod_sys_fail()

void rb_mod_sys_fail | ( | VALUE | mod,
|  | const char * | msg )

Identical to rb_sys_fail(), except it takes additional module to extend the exception object before raising.

Parameters

  [in] | mod | A rb_cModule instance.
  [in] | msg | Additional message to raise.

Exceptions

  rb_eSystemCallError | An exception representing errno.

Note
  It never returns.

Definition at line 3329 of file error.c.

## ◆ rb_mod_sys_fail_str()

void rb_mod_sys_fail_str | ( | VALUE | mod,
|  | VALUE | msg )

Identical to rb_mod_sys_fail(), except it takes the message in Ruby's String instead of C's.

Parameters

  [in] | mod | A rb_cModule instance.
  [in] | msg | Additional message to raise.

Exceptions

  rb_eSystemCallError | An exception representing errno.

Note
  It never returns.

Definition at line 3336 of file error.c.

## ◆ rb_mod_syserr_fail()

void rb_mod_syserr_fail | ( | VALUE | mod,
|  | int | err,
|  | const char * | msg )

Identical to rb_mod_sys_fail(), except it does not depend on C global variable errno.

Pass it explicitly.

Parameters

  [in] | mod | A rb_cModule instance.
  [in] | err | C level errno.
  [in] | msg | Additional message to raise.

Exceptions

  rb_eSystemCallError | An exception representing `err`.

Note
  It never returns.

Definition at line 3343 of file error.c.

## ◆ rb_mod_syserr_fail_str()

void rb_mod_syserr_fail_str | ( | VALUE | mod,
|  | int | err,
|  | VALUE | msg )

Identical to rb_mod_syserr_fail(), except it takes the message in Ruby's String instead of C's.

Parameters

  [in] | mod | A rb_cModule instance.
  [in] | err | C level errno.
  [in] | msg | Additional message to raise.

Exceptions

  rb_eSystemCallError | An exception representing `err`.

Note
  It never returns.

Definition at line 3350 of file error.c.

Referenced by rb_readwrite_syserr_fail().

## ◆ rb_name_err_mesg_init()

static VALUE rb_name_err_mesg_init | ( | VALUE | klass,
|  | VALUE | mesg,
|  | VALUE | recv,
|  | VALUE | method )
| static

Definition at line 1988 of file error.c.

## ◆ rb_name_err_mesg_new()

static VALUE rb_name_err_mesg_new | ( | VALUE | mesg,
|  | VALUE | recv,
|  | VALUE | method )
| static

Definition at line 2002 of file error.c.

## ◆ rb_name_err_new()

VALUE rb_name_err_new | ( | VALUE | mesg,
|  | VALUE | recv,
|  | VALUE | method )

Definition at line 1865 of file error.c.

## ◆ rb_name_error()

void rb_name_error | ( | ID | name,
|  | const char * | fmt,
|  |  | ... )

Raises an instance of rb_eNameError.

The name can be obtained later using `NameError#name` of the raising exception.

Parameters

  [in] | name | What failed.
  [in] | fmt | Format specifier string compatible with rb_sprintf().

Exceptions

  rb_eNameError | Always raises this.

Note
  It never returns.

Definition at line 1784 of file error.c.

Referenced by rb_f_untrace_var(), and rb_id_attrset().

## ◆ rb_name_error_str()

void rb_name_error_str | ( | VALUE | name,
|  | const char * | fmt,
|  |  | ... )

Identical to rb_name_error(), except it takes a VALUE instead of ID.

Parameters

  [in] | name | What failed.
  [in] | fmt | Format specifier string compatible with rb_sprintf().

Exceptions

  rb_eNameError | Always raises this.

Note
  It never returns.

Definition at line 1799 of file error.c.

Referenced by rb_f_untrace_var(), and rb_id_attrset().

## ◆ rb_nomethod_err_new()

VALUE rb_nomethod_err_new | ( | VALUE | mesg,
|  | VALUE | recv,
|  | VALUE | method,
|  | VALUE | args,
|  | int | priv )

Definition at line 1946 of file error.c.

## ◆ rb_notimplement()

void rb_notimplement | ( | void |  | ) |

Exceptions

  rb_eNotImpError |

Note
  It never returns.

Definition at line 3193 of file error.c.

## ◆ rb_raise()

void rb_raise | ( | VALUE | exc,
|  | const char * | fmt,
|  |  | ... )

Exception entry point.

By calling this function the execution of your program gets interrupted to "raise" an exception up to the callee entities. Programs could "rescue" that exception, or could "ensure" some part of them. If nobody cares about such things, the raised exception reaches at the top of execution. This yields abnormal end of the process.

Parameters

  [in] | exc | A subclass of rb_eException.
  [in] | fmt | Format specifier string compatible with rb_sprintf().

Exceptions

  exc | The specified exception.

Note
  It never returns.

Definition at line 3150 of file error.c.

Referenced by rb_alias(), rb_alias_variable(), rb_arithmetic_sequence_beg_len_step(), rb_ary_resize(), rb_ary_store(), rb_autoload_load(), rb_big2long(), rb_big2ulong(), rb_check_id(), rb_check_inheritable(), rb_check_symbol(), rb_check_typeddata(), rb_class_attached_object(), rb_class_inherited_p(), rb_class_superclass(), rb_cmperr(), rb_current_receiver(), rb_define_class(), rb_define_module(), rb_define_module_id_under(), rb_econv_append(), rb_econv_prepare_options(), rb_enc_associate_index(), rb_enc_codelen(), rb_enc_codepoint_len(), rb_enc_find_index(), rb_enc_set_default_external(), rb_enc_str_new_cstr(), rb_enc_uint_chr(), rb_enc_vsprintf(), rb_eof_error(), rb_error_frozen(), rb_f_global_variables(), rb_fix2str(), rb_Hash(), rb_include_module(), rb_integer_unpack(), rb_invalid_str(), rb_io_check_byte_readable(), rb_io_check_char_readable(), rb_io_check_initialized(), rb_io_check_writable(), rb_io_extract_modeenc(), rb_io_modestr_fmode(), rb_io_ungetc(), rb_memory_view_prepare_item_desc(), rb_method_call_with_block_kw(), rb_must_asciicompat(), rb_mutex_unlock(), rb_notimplement(), rb_num2dbl(), rb_num2fix(), rb_num2long(), rb_num_zerodiv(), rb_obj_encoding(), rb_obj_init_copy(), rb_obj_is_kind_of(), rb_out_of_int(), rb_path_to_class(), rb_prepend_module(), rb_random_real(), rb_random_ulong_limited(), rb_range_beg_len(), rb_reg_regsub(), rb_set_errinfo(), rb_str_cat(), rb_str_concat(), rb_str_dump(), rb_str_ellipsize(), rb_str_format(), rb_str_modify_expand(), rb_str_plus(), rb_str_resize(), rb_str_set_len(), rb_str_times(), rb_str_unlocktmp(), rb_str_update(), rb_string_value_cstr(), rb_struct_members(), rb_struct_s_members(), rb_sym2id(), rb_thread_stop(), rb_thread_wakeup(), rb_time_timespec_new(), rb_tracearg_object(), rb_tracearg_raised_exception(), rb_tracearg_return_value(), rb_tracepoint_enable(), rb_undef(), rb_uv_to_utf8(), rb_yield_splat(), and rb_yield_splat_kw().

## ◆ rb_readwrite_sys_fail()

void rb_readwrite_sys_fail | ( | enum rb_io_wait_readwrite | waiting,
|  | const char * | msg )

Raises appropriate exception using the parameters.

In Ruby level there are rb_eEAGAINWaitReadable etc. This function maps the given parameter to an appropriate exception class, then raises it.

Parameters

  [in] | waiting | Reason for the IO to wait.
  [in] | msg | Additional message to raise.

Exceptions

  rb_eEAGAINWaitWritable |
  rb_eEWOULDBLOCKWaitWritable |
  rb_eEINPROGRESSWaitWritable |
  rb_eEAGAINWaitReadable |
  rb_eEWOULDBLOCKWaitReadable |
  rb_eEINPROGRESSWaitReadable |
  rb_eSystemCallError |

Note
  It never returns.

Definition at line 14570 of file io.c.

## ◆ rb_readwrite_syserr_fail()

void rb_readwrite_syserr_fail | ( | enum rb_io_wait_readwrite | waiting,
|  | int | err,
|  | const char * | msg )

Identical to rb_readwrite_sys_fail(), except it does not depend on C global variable errno.

Pass it explicitly.

Parameters

  [in] | waiting | Reason for the IO to wait.
  [in] | err | C level errno.
  [in] | msg | Additional message to raise.

Exceptions

  rb_eEAGAINWaitWritable |
  rb_eEWOULDBLOCKWaitWritable |
  rb_eEINPROGRESSWaitWritable |
  rb_eEAGAINWaitReadable |
  rb_eEWOULDBLOCKWaitReadable |
  rb_eEINPROGRESSWaitReadable |
  rb_eSystemCallError |

Note
  It never returns.

Definition at line 14576 of file io.c.

Referenced by rb_readwrite_sys_fail().

## ◆ rb_report_bug_valist()

void rb_report_bug_valist | ( | VALUE | file,
|  | int | line,
|  | const char * | fmt,
|  | va_list | args )

Definition at line 865 of file error.c.

## ◆ rb_rescue()

VALUE rb_rescue | ( | VALUE(* | b_proc )(VALUE),
|  | VALUE | data1,
|  | VALUE(* | r_proc )(VALUE, VALUE),
|  | VALUE | data2 )

Identical to rb_rescue2(), except it does not take a list of exception classes.

This is a shorthand of:

rb_rescue2(b_proc, data1, r_proc, data2, rb_eStandardError, (VALUE)0);
rb_rescue2
VALUE rb_rescue2(VALUE(*b_proc)(VALUE), VALUE data1, VALUE(*r_proc)(VALUE, VALUE), VALUE data2,...)
An equivalent of rescue clause.
Definition eval.c:897
rb_eStandardError
VALUE rb_eStandardError
StandardError exception.
Definition error.c:1088

Parameters

  [in] | b_proc | A function which potentially raises an exception.
  [in,out] | data1 | Passed to `b_proc`.
  [in] | r_proc | A function which rescues an exception in `b_proc`.
  [in,out] | data2 | The first argument of `r_proc`.

Returns
  The return value of `b_proc` if no exception occurs, or the return value of `r_proc` otherwise.

See also
  rb_rescue
  rb_ensure
  rb_protect

Definition at line 968 of file eval.c.

## ◆ rb_rescue2()

VALUE rb_rescue2 | ( | VALUE(* | b_proc )(VALUE),
|  | VALUE | data1,
|  | VALUE(* | r_proc )(VALUE, VALUE),
|  | VALUE | data2,
|  |  | ... )

An equivalent of `rescue` clause.

First it calls the function `b_proc` with `data1` as the argument. If nothing is thrown the function happily returns the return value of `b_proc`. When `b_proc` raises an exception, and the exception is a kind of one of the given exception classes, it then calls `r_proc` with `data2` and that exception. If the exception does not match any of them, it propagates.

Parameters

  [in] | b_proc | A function which potentially raises an exception.
  [in,out] | data1 | Passed to `b_proc`.
  [in] | r_proc | A function which rescues an exception in `b_proc`.
  [in,out] | data2 | The first argument of `r_proc`.
  [in] | ... | 1 or more exception classes. Must be terminated by `(VALUE)0`

Returns
  The return value of `b_proc` if no exception occurs, or the return value of `r_proc` otherwise.

See also
  rb_rescue
  rb_ensure
  rb_protect

Definition at line 897 of file eval.c.

Referenced by rb_rescue().

## ◆ rb_set_errinfo()

void rb_set_errinfo | ( | VALUE | err | ) |

Sets the current exception (`$!`) to the given value.

Parameters

  [in] | err | An instance of rb_eException, or RUBY_Qnil.

Exceptions

  rb_eTypeError | What is given was neither rb_eException nor RUBY_Qnil.

Note
  Use rb_raise() instead to raise `err`. This function just assigns the given object to the global variable.

Definition at line 1884 of file eval.c.

## ◆ rb_str_end_with_asciichar()

int rb_str_end_with_asciichar | ( | VALUE | str,
|  | int | c )

Definition at line 8820 of file io.c.

## ◆ rb_strerrno()

static const char * rb_strerrno | ( | int | err | ) |
| static

Definition at line 89 of file error.c.

## ◆ rb_syntax_error_append()

VALUE rb_syntax_error_append | ( | VALUE | exc,
|  | VALUE | file,
|  | int | line,
|  | int | column,
|  | rb_encoding * | enc,
|  | const char * | fmt,
|  | va_list | args )

Definition at line 131 of file error.c.

## ◆ rb_sys_enc_warning()

void rb_sys_enc_warning | ( | rb_encoding * | enc,
|  | const char * | fmt,
|  |  | ... )

Definition at line 3435 of file error.c.

## ◆ rb_sys_fail()

void rb_sys_fail | ( | const char * | msg | ) |

Converts a C errno into a Ruby exception, then raises it.

For instance:

static VALUE
foo(VALUE argv)
{
const auto cmd = StringValueCStr(argv);
const auto waitr = system(cmd);
if (waitr == -1) {
rb_sys_fail("system(3posix)"); // <-------------- this
}
else {
return INT2FIX(fd);
}
}
INT2FIX
#define INT2FIX
Old name of RB_INT2FIX.
Definition long.h:48
rb_sys_fail
void rb_sys_fail(const char *mesg)
Converts a C errno into a Ruby exception, then raises it.
Definition error.c:3274
StringValueCStr
#define StringValueCStr(v)
Identical to StringValuePtr, except it additionally checks for the contents for viability as a C stri...
Definition rstring.h:95

Parameters

  [in] | msg | Additional message to raise.

Exceptions

  rb_eSystemCallError | An exception representing errno.

Note
  It never returns.

Definition at line 3274 of file error.c.

Referenced by rb_f_kill(), rb_io_wait(), rb_timespec_now(), and ruby_getcwd().

## ◆ rb_sys_fail_str()

void rb_sys_fail_str | ( | VALUE | msg | ) |

Identical to rb_sys_fail(), except it takes the message in Ruby's String instead of C's.

Parameters

  [in] | msg | Additional message to raise.

Exceptions

  rb_eSystemCallError | An exception representing errno.

Note
  It never returns.

Definition at line 3280 of file error.c.

Referenced by ruby_setenv().

## ◆ rb_sys_warning()

void rb_sys_warning | ( | const char * | fmt,
|  |  | ... )

Identical to rb_sys_fail(), except it does not raise an exception to render a warning instead.

Note
  This function is affected by the `-W` flag.

Parameters

  [in] | fmt | Format specifier string compatible with rb_sprintf().

Definition at line 3411 of file error.c.

## ◆ rb_syserr_enc_warning()

void rb_syserr_enc_warning | ( | int | err,
|  | rb_encoding * | enc,
|  | const char * | fmt,
|  |  | ... )

Definition at line 3447 of file error.c.

## ◆ rb_syserr_fail()

void rb_syserr_fail | ( | int | err,
|  | const char * | msg )

Raises appropriate exception that represents a C errno.

Parameters

  [in] | err | C level errno.
  [in] | msg | Additional message to raise.

Exceptions

  rb_eSystemCallError | An exception representing `err`.

Note
  It never returns.

Definition at line 3262 of file error.c.

Referenced by rb_fdopen(), and ruby_getcwd().

## ◆ rb_syserr_fail_str()

void rb_syserr_fail_str | ( | int | err,
|  | VALUE | msg )

Identical to rb_syserr_fail(), except it takes the message in Ruby's String instead of C's.

Parameters

  [in] | err | C level errno.
  [in] | msg | Additional message to raise.

Exceptions

  rb_eSystemCallError | An exception representing `err`.

Note
  It never returns.

Definition at line 3268 of file error.c.

Referenced by rb_f_exec().

## ◆ rb_syserr_new()

VALUE rb_syserr_new | ( | int | err,
|  | const char * | msg )

Creates an exception object that represents the given C errno.

Parameters

  [in] | err | C level errno.
  [in] | msg | Additional message.

Return values

  rb_eSystemCallError | An exception for the errno.

Definition at line 3248 of file error.c.

Referenced by rb_mod_syserr_fail(), and rb_syserr_fail().

## ◆ rb_syserr_new_str()

VALUE rb_syserr_new_str | ( | int | n,
|  | VALUE | arg )

Identical to rb_syserr_new(), except it takes the message in Ruby's String instead of C's.

Parameters

  [in] | n | C level errno.
  [in] | arg | Additional message.

Return values

  rb_eSystemCallError | An exception for the errno.

Definition at line 3256 of file error.c.

Referenced by rb_mod_syserr_fail_str(), rb_syserr_fail_str(), and rb_syserr_new().

## ◆ rb_typeddata_inherited_p()

int rb_typeddata_inherited_p | ( | const rb_data_type_t * | child,
|  | const rb_data_type_t * | parent )

Checks for the domestic relationship between the two.

Parameters

  [in] | child | A data type supposed to be a child of `parent`.
  [in] | parent | A data type supposed to be a parent of `child`.

Return values

  true | `child` is a descendent of `parent`.
  false | Otherwise.

Definition at line 1031 of file error.c.

Referenced by rb_check_typeddata(), and rb_typeddata_is_kind_of().

## ◆ rb_typeddata_is_instance_of()

int rb_typeddata_is_instance_of | ( | VALUE | obj,
|  | const rb_data_type_t * | data_type )

Definition at line 1052 of file error.c.

## ◆ rb_typeddata_is_kind_of()

int rb_typeddata_is_kind_of | ( | VALUE | obj,
|  | const rb_data_type_t * | data_type )

Checks if the given object is of given kind.

Parameters

  [in] | obj | An instance of RTypedData.
  [in] | data_type | Expected data type of `obj`.

Return values

  true | `obj` is of `data_type`.
  false | Otherwise.

Definition at line 1041 of file error.c.

Referenced by rb_obj_is_fiber(), rb_obj_is_method(), and rb_obj_is_proc().

## ◆ rb_unexpected_type()

void rb_unexpected_type | ( | VALUE | self,
|  | int | t )

Fails with the given object's type incompatibility to the type.

It seems this function is visible from extension libraries only because RTYPEDDATA_TYPE() uses it on RUBY_DEBUG. So you can basically ignore it; use some other fine-grained method instead.

Parameters

  [in] | self | The object in question.
  [in] | t | Expected type of the object.

Exceptions

  rb_eTypeError | `self` not in type `t`.

Note
  It never returns.
  The second argument must have been an enum ruby_value_type, but for historical reasons it remains to be an int (in other words we see no benefits fixing this bug).

Definition at line 1021 of file error.c.

Referenced by Check_Type(), and RTYPEDDATA_TYPE().

## ◆ rb_vraise()

void rb_vraise | ( | VALUE | exc,
|  | const char * | fmt,
|  | va_list | ap )

Definition at line 3144 of file error.c.

## ◆ rb_vrescue2()

VALUE rb_vrescue2 | ( | VALUE(* | b_proc )(VALUE),
|  | VALUE | data1,
|  | VALUE(* | r_proc )(VALUE, VALUE),
|  | VALUE | data2,
|  | va_list | ap )

Identical to rb_rescue2(), except it takes `va_list` instead of variadic number of arguments.

This is exposed to 3rd parties because inline functions use it. Basically you don't have to bother.

Parameters

  [in] | b_proc | A function which potentially raises an exception.
  [in,out] | data1 | Passed to `b_proc`.
  [in] | r_proc | A function which rescues an exception in `b_proc`.
  [in,out] | data2 | The first argument of `r_proc`.
  [in] | ap | 1 or more exception classes. Must be terminated by `(VALUE)0`

Returns
  The return value of `b_proc` if no exception occurs, or the return value of `r_proc` otherwise.

See also
  rb_rescue
  rb_ensure
  rb_protect

Definition at line 908 of file eval.c.

Referenced by rb_rescue2(), and ruby::backward::cxxanyargs::rb_rescue2().

## ◆ rb_warn()

void rb_warn | ( | const char * | fmt,
|  |  | ... )

Identical to rb_warning(), except it reports always regardless of runtime `-W` flag.

Parameters

  [in] | fmt | Format specifier string compatible with rb_sprintf().

Definition at line 411 of file error.c.

Referenced by rb_big_pow(), rb_complex_pow(), rb_define_const(), rb_enc_find_index(), rb_fdopen(), rb_io_extract_encoding_option(), rb_str_format(), and rb_undef().

## ◆ rb_warn_category()

static VALUE rb_warn_category | ( | VALUE | str,
|  | VALUE | category )
| static

Definition at line 321 of file error.c.

## ◆ rb_warn_deprecated()

void rb_warn_deprecated | ( | const char * | fmt,
|  | const char * | suggest,
|  |  | ... )

Definition at line 504 of file error.c.

## ◆ rb_warn_deprecated_to_remove()

void rb_warn_deprecated_to_remove | ( | const char * | removal,
|  | const char * | fmt,
|  | const char * | suggest,
|  |  | ... )

Definition at line 514 of file error.c.

## ◆ rb_warn_m()

static VALUE rb_warn_m | ( | rb_execution_context_t * | ec,
|  | VALUE | exc,
|  | VALUE | msgs,
|  | VALUE | uplevel,
|  | VALUE | category )
| static

Definition at line 543 of file error.c.

## ◆ rb_warning()

void rb_warning | ( | const char * | fmt,
|  |  | ... )

Issues a warning.

In ruby, warnings these days are tightly coupled with the rb_mWarning constant and its `warn` singleton method. This CAPI is just a thin wrapper of it; everything passed are formatted like what rb_sprintf() does, then passed through to the method. Programs can have their own `def Warning.warn` at will to do whatever they want, from ignoring the warnings at all to sinking them to some BigQuery data set via a Fluentd cluster. By default, the method just emits its passed contents to rb_stderr using rb_io_write().

Note
  This function is affected by the `-W` flag.

Parameters

  [in] | fmt | Format specifier string compatible with rb_sprintf().

Definition at line 442 of file error.c.

Referenced by rb_attr(), rb_big2dbl(), rb_gv_get(), and rb_memory_view_register().

## ◆ rb_warning_category_enabled_p()

bool rb_warning_category_enabled_p | ( | rb_warning_category_t | category | ) |

Definition at line 191 of file error.c.

## ◆ rb_warning_category_from_name()

rb_warning_category_t rb_warning_category_from_name | ( | VALUE | category | ) |

Definition at line 161 of file error.c.

## ◆ rb_warning_category_mask()

static unsigned int rb_warning_category_mask | ( | VALUE | category | ) |
| static

Definition at line 155 of file error.c.

## ◆ rb_warning_category_to_name()

static VALUE rb_warning_category_to_name | ( | rb_warning_category_t | category | ) |
| static

Definition at line 174 of file error.c.

## ◆ rb_warning_category_update()

void rb_warning_category_update | ( | unsigned int | mask,
|  | unsigned int | bits )

Definition at line 184 of file error.c.

## ◆ rb_warning_s_aref()

static VALUE rb_warning_s_aref | ( | VALUE | mod,
|  | VALUE | category )
| static

Definition at line 214 of file error.c.

## ◆ rb_warning_s_aset()

static VALUE rb_warning_s_aset | ( | VALUE | mod,
|  | VALUE | category,
|  | VALUE | flag )
| static

Definition at line 229 of file error.c.

## ◆ rb_warning_s_warn()

static VALUE rb_warning_s_warn | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | mod )
| static

Definition at line 253 of file error.c.

## ◆ rb_warning_string()

VALUE rb_warning_string | ( | const char * | fmt,
|  |  | ... )

Definition at line 463 of file error.c.

## ◆ rb_warning_warn()

static VALUE rb_warning_warn | ( | VALUE | mod,
|  | VALUE | str )
| static

Definition at line 307 of file error.c.

## ◆ rb_warning_warn_arity()

static int rb_warning_warn_arity | ( | void |  | ) |
| static

Definition at line 314 of file error.c.

## ◆ rb_write_warning_str()

static void rb_write_warning_str | ( | VALUE | str | ) |
| static

Definition at line 340 of file error.c.

## ◆ set_syserr()

static VALUE set_syserr | ( | int | n,
|  | const char * | name )
| static

Definition at line 2404 of file error.c.

## ◆ syntax_error_initialize()

static VALUE syntax_error_initialize | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self )
| static

Definition at line 2341 of file error.c.

## ◆ syntax_error_with_path()

static VALUE syntax_error_with_path | ( | VALUE | exc,
|  | VALUE | path,
|  | VALUE * | mesg,
|  | rb_encoding * | enc )
| static

Definition at line 2353 of file error.c.

## ◆ syserr_eqq()

static VALUE syserr_eqq | ( | VALUE | self,
|  | VALUE | exc )
| static

Definition at line 2526 of file error.c.

## ◆ syserr_errno()

static VALUE syserr_errno | ( | VALUE | self | ) |
| static

Definition at line 2512 of file error.c.

## ◆ syserr_initialize()

static VALUE syserr_initialize | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self )
| static

Definition at line 2462 of file error.c.

## ◆ syserr_warning()

static void syserr_warning | ( | VALUE | mesg,
|  | int | err )
| static

Definition at line 3357 of file error.c.

## ◆ try_convert_to_exception()

static VALUE try_convert_to_exception | ( | VALUE | obj | ) |
| static

Definition at line 1607 of file error.c.

## ◆ unexpected_type()

static void unexpected_type | ( | VALUE | x,
|  | int | xt,
|  | int | t )
| static

Definition at line 977 of file error.c.

## ◆ warn_deprecated()

static void warn_deprecated | ( | VALUE | mesg,
|  | const char * | removal,
|  | const char * | suggest )
| static

Definition at line 491 of file error.c.

## ◆ warn_vsprintf()

static VALUE warn_vsprintf | ( | rb_encoding * | enc,
|  | const char * | file,
|  | int | line,
|  | const char * | fmt,
|  | va_list | args )
| static

Definition at line 347 of file error.c.

## ◆ warning_string()

static VALUE warning_string | ( | rb_encoding * | enc,
|  | const char * | fmt,
|  | va_list | args )
| static

Definition at line 395 of file error.c.

## ◆ warning_write()

static VALUE warning_write | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | buf )
| static

Definition at line 532 of file error.c.

## Variable Documentation

## ◆ bug_reporters_size

int bug_reporters_size
| static

Definition at line 603 of file error.c.

## ◆ builtin_types

const char builtin_types[][10]
| static

Definition at line 883 of file error.c.

## ◆ []

st_table * { ... } ::enum2id

Definition at line 83 of file error.c.

## ◆ []

st_table* { ... } ::id2enum

Definition at line 83 of file error.c.

## ◆ id_args

ID id_args
| static

Definition at line 1118 of file error.c.

## ◆ id_backtrace

ID id_backtrace
| static

Definition at line 1117 of file error.c.

## ◆ id_bottom

ID id_bottom
| static

Definition at line 1120 of file error.c.

## ◆ id_category

ID id_category
| static

Definition at line 77 of file error.c.

## ◆ id_deprecated

ID id_deprecated
| static

Definition at line 78 of file error.c.

## ◆ id_detailed_message

ID id_detailed_message
| static

Definition at line 1117 of file error.c.

## ◆ id_Errno

ID id_Errno
| static

Definition at line 1118 of file error.c.

## ◆ id_errno

ID id_errno
| static

Definition at line 1118 of file error.c.

## ◆ id_experimental

ID id_experimental
| static

Definition at line 79 of file error.c.

## ◆ id_i_path

ID id_i_path
| static

Definition at line 1118 of file error.c.

## ◆ id_iseq

ID id_iseq
| static

Definition at line 1119 of file error.c.

## ◆ id_key

ID id_key
| static

Definition at line 1118 of file error.c.

## ◆ id_local_variables

ID id_local_variables
| static

Definition at line 1119 of file error.c.

## ◆ id_matchee

ID id_matchee
| static

Definition at line 1118 of file error.c.

## ◆ id_message

ID id_message
| static

Definition at line 1117 of file error.c.

## ◆ id_private_call_p

ID id_private_call_p
| static

Definition at line 1120 of file error.c.

## ◆ id_receiver

ID id_receiver
| static

Definition at line 1119 of file error.c.

## ◆ id_recv

ID id_recv
| static

Definition at line 1119 of file error.c.

## ◆ id_top

ID id_top
| static

Definition at line 1120 of file error.c.

## ◆ id_warn

ID id_warn
| static

Definition at line 76 of file error.c.

## ◆ name_err_mesg_data_type

const rb_data_type_t name_err_mesg_data_type
| static

Initial value:
= {
"name_err_mesg",
{
name_err_mesg_mark,
name_err_mesg_free,
name_err_mesg_memsize,
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
}

Definition at line 1976 of file error.c.

## ◆ rb_backtrace_length_limit

long rb_backtrace_length_limit = -1

Definition at line 69 of file error.c.

## ◆ rb_cNameErrorMesg

VALUE rb_cNameErrorMesg

`NameError::Message` class.

Definition at line 1103 of file error.c.

## ◆ rb_cWarningBuffer

VALUE rb_cWarningBuffer
| static

Definition at line 74 of file error.c.

## ◆ rb_dynamic_description

const char* rb_dynamic_description
| extern

Definition at line 82 of file version.c.

## ◆ rb_eArgError [1/2]

VALUE rb_eArgError

`ArgumentError` exception.

Definition at line 1092 of file error.c.

Referenced by rb_cmperr(), rb_define_class(), rb_econv_append(), rb_econv_prepare_options(), rb_enc_associate_index(), rb_enc_codelen(), rb_enc_codepoint_len(), rb_enc_find_index(), rb_enc_set_default_external(), rb_enc_str_new_cstr(), rb_enc_vsprintf(), rb_fix2str(), rb_include_module(), rb_integer_unpack(), rb_invalid_str(), rb_io_extract_modeenc(), rb_io_modestr_fmode(), rb_path_to_class(), rb_prepend_module(), rb_str_cat(), rb_str_format(), rb_str_modify_expand(), rb_str_plus(), rb_str_resize(), rb_str_times(), rb_string_value_cstr(), rb_time_timespec_new(), rb_tracepoint_enable(), rb_yield_splat(), and rb_yield_splat_kw().

## ◆ rb_eArgError [2/2]

VALUE rb_eArgError
| extern

`ArgumentError` exception.

Definition at line 1092 of file error.c.

Referenced by rb_cmperr(), rb_define_class(), rb_econv_append(), rb_econv_prepare_options(), rb_enc_associate_index(), rb_enc_codelen(), rb_enc_codepoint_len(), rb_enc_find_index(), rb_enc_set_default_external(), rb_enc_str_new_cstr(), rb_enc_vsprintf(), rb_fix2str(), rb_include_module(), rb_integer_unpack(), rb_invalid_str(), rb_io_extract_modeenc(), rb_io_modestr_fmode(), rb_path_to_class(), rb_prepend_module(), rb_str_cat(), rb_str_format(), rb_str_modify_expand(), rb_str_plus(), rb_str_resize(), rb_str_times(), rb_string_value_cstr(), rb_time_timespec_new(), rb_tracepoint_enable(), rb_yield_splat(), and rb_yield_splat_kw().

## ◆ rb_eEAGAIN

VALUE rb_eEAGAIN

Definition at line 70 of file error.c.

## ◆ rb_eEINPROGRESS

VALUE rb_eEINPROGRESS

Definition at line 72 of file error.c.

## ◆ rb_eEncCompatError [1/2]

VALUE rb_eEncCompatError

`Encoding::CompatibilityError` exception.

Definition at line 1098 of file error.c.

Referenced by rb_must_asciicompat().

## ◆ rb_eEncCompatError [2/2]

VALUE rb_eEncCompatError
| extern

`Encoding::CompatibilityError` exception.

Definition at line 1098 of file error.c.

Referenced by rb_must_asciicompat().

## ◆ rb_eEncodingError [1/2]

VALUE rb_eEncodingError

`EncodingError` exception.

Definition at line 1097 of file error.c.

## ◆ rb_eEncodingError [2/2]

VALUE rb_eEncodingError
| extern

`EncodingError` exception.

Definition at line 1097 of file error.c.

## ◆ rb_eEOFError

VALUE rb_eEOFError
| extern

`EOFError` exception.

Definition at line 181 of file io.c.

Referenced by rb_eof_error().

## ◆ rb_eEWOULDBLOCK

VALUE rb_eEWOULDBLOCK

Definition at line 71 of file error.c.

## ◆ rb_eException [1/2]

VALUE rb_eException

Mother of all exceptions.

Definition at line 1083 of file error.c.

Referenced by rb_set_errinfo().

## ◆ rb_eException [2/2]

VALUE rb_eException
| extern

Mother of all exceptions.

Definition at line 1083 of file error.c.

Referenced by rb_set_errinfo().

## ◆ rb_eFatal [1/2]

VALUE rb_eFatal

`fatal` exception.

Definition at line 1087 of file error.c.

Referenced by rb_fatal().

## ◆ rb_eFatal [2/2]

VALUE rb_eFatal
| extern

`fatal` exception.

Definition at line 1087 of file error.c.

Referenced by rb_fatal().

## ◆ rb_eFloatDomainError

VALUE rb_eFloatDomainError
| extern

`FloatDomainError` exception.

Definition at line 195 of file numeric.c.

## ◆ rb_eFrozenError [1/2]

VALUE rb_eFrozenError

`FrozenError` exception.

Definition at line 1090 of file error.c.

Referenced by rb_error_frozen(), rb_error_frozen_object(), and rb_frozen_error_raise().

## ◆ rb_eFrozenError [2/2]

VALUE rb_eFrozenError
| extern

`FrozenError` exception.

Definition at line 1090 of file error.c.

Referenced by rb_error_frozen(), rb_error_frozen_object(), and rb_frozen_error_raise().

## ◆ rb_eIndexError [1/2]

VALUE rb_eIndexError

`IndexError` exception.

Definition at line 1093 of file error.c.

Referenced by rb_ary_resize(), rb_ary_store(), rb_str_ellipsize(), and rb_str_update().

## ◆ rb_eIndexError [2/2]

VALUE rb_eIndexError
| extern

`IndexError` exception.

Definition at line 1093 of file error.c.

Referenced by rb_ary_resize(), rb_ary_store(), rb_str_ellipsize(), and rb_str_update().

## ◆ rb_eInterrupt [1/2]

VALUE rb_eInterrupt

`Interrupt` exception.

Definition at line 1085 of file error.c.

Referenced by rb_interrupt().

## ◆ rb_eInterrupt [2/2]

VALUE rb_eInterrupt
| extern

`Interrupt` exception.

Definition at line 1085 of file error.c.

Referenced by rb_interrupt().

## ◆ rb_eIOError

VALUE rb_eIOError
| extern

`IOError` exception.

Definition at line 182 of file io.c.

Referenced by rb_io_check_byte_readable(), rb_io_check_char_readable(), rb_io_check_initialized(), rb_io_check_writable(), and rb_io_ungetc().

## ◆ rb_eKeyError [1/2]

VALUE rb_eKeyError

`KeyError` exception.

Definition at line 1094 of file error.c.

## ◆ rb_eKeyError [2/2]

VALUE rb_eKeyError
| extern

`KeyError` exception.

Definition at line 1094 of file error.c.

## ◆ rb_eLoadError [1/2]

VALUE rb_eLoadError

`LoadError` exception.

Definition at line 1109 of file error.c.

## ◆ rb_eLoadError [2/2]

VALUE rb_eLoadError
| extern

`LoadError` exception.

Definition at line 1109 of file error.c.

## ◆ rb_eLocalJumpError

VALUE rb_eLocalJumpError
| extern

`LocalJumpError` exception.

Definition at line 49 of file eval.c.

## ◆ rb_eMathDomainError

VALUE rb_eMathDomainError
| extern

`Math::DomainError` exception.

Definition at line 30 of file math.c.

## ◆ rb_eNameError [1/2]

VALUE rb_eNameError

`NameError` exception.

Definition at line 1096 of file error.c.

Referenced by rb_name_error(), and rb_name_error_str().

## ◆ rb_eNameError [2/2]

VALUE rb_eNameError
| extern

`NameError` exception.

Definition at line 1096 of file error.c.

Referenced by rb_name_error(), and rb_name_error_str().

## ◆ rb_eNOERROR

VALUE rb_eNOERROR
| static

Definition at line 1113 of file error.c.

## ◆ rb_eNoMatchingPatternError [1/2]

VALUE rb_eNoMatchingPatternError

`NoMatchingPatternError` exception.

Definition at line 1104 of file error.c.

## ◆ rb_eNoMatchingPatternError [2/2]

VALUE rb_eNoMatchingPatternError
| extern

`NoMatchingPatternError` exception.

Definition at line 1104 of file error.c.

## ◆ rb_eNoMatchingPatternKeyError [1/2]

VALUE rb_eNoMatchingPatternKeyError

`NoMatchingPatternKeyError` exception.

Definition at line 1105 of file error.c.

## ◆ rb_eNoMatchingPatternKeyError [2/2]

VALUE rb_eNoMatchingPatternKeyError
| extern

`NoMatchingPatternKeyError` exception.

Definition at line 1105 of file error.c.

## ◆ rb_eNoMemError [1/2]

VALUE rb_eNoMemError

`NoMemoryError` exception.

Definition at line 1102 of file error.c.

## ◆ rb_eNoMemError [2/2]

VALUE rb_eNoMemError
| extern

`NoMemoryError` exception.

Definition at line 1102 of file error.c.

## ◆ rb_eNoMethodError [1/2]

VALUE rb_eNoMethodError

`NoMethodError` exception.

Definition at line 1099 of file error.c.

## ◆ rb_eNoMethodError [2/2]

VALUE rb_eNoMethodError
| extern

`NoMethodError` exception.

Definition at line 1099 of file error.c.

## ◆ rb_eNotImpError [1/2]

VALUE rb_eNotImpError

`NotImplementedError` exception.

Definition at line 1101 of file error.c.

Referenced by rb_notimplement().

## ◆ rb_eNotImpError [2/2]

VALUE rb_eNotImpError
| extern

`NotImplementedError` exception.

Definition at line 1101 of file error.c.

Referenced by rb_notimplement().

## ◆ rb_eRangeError [1/2]

VALUE rb_eRangeError

`RangeError` exception.

Definition at line 1095 of file error.c.

Referenced by rb_arithmetic_sequence_beg_len_step(), rb_big2long(), rb_big2ulong(), rb_enc_uint_chr(), rb_num2fix(), rb_out_of_int(), rb_random_real(), rb_random_ulong_limited(), rb_range_beg_len(), rb_str_concat(), and rb_uv_to_utf8().

## ◆ rb_eRangeError [2/2]

VALUE rb_eRangeError
| extern

`RangeError` exception.

Definition at line 1095 of file error.c.

Referenced by rb_arithmetic_sequence_beg_len_step(), rb_big2long(), rb_big2ulong(), rb_enc_uint_chr(), rb_num2fix(), rb_out_of_int(), rb_random_real(), rb_random_ulong_limited(), rb_range_beg_len(), rb_str_concat(), and rb_uv_to_utf8().

## ◆ rb_eRegexpError

VALUE rb_eRegexpError
| extern

`RegexpError` exception.

Definition at line 32 of file re.c.

## ◆ rb_eRuntimeError [1/2]

VALUE rb_eRuntimeError

`RuntimeError` exception.

Definition at line 1089 of file error.c.

Referenced by rb_alias_variable(), rb_current_receiver(), rb_memory_view_prepare_item_desc(), rb_reg_regsub(), rb_str_dump(), rb_str_set_len(), rb_str_unlocktmp(), rb_tracearg_object(), rb_tracearg_raised_exception(), and rb_tracearg_return_value().

## ◆ rb_eRuntimeError [2/2]

VALUE rb_eRuntimeError
| extern

`RuntimeError` exception.

Definition at line 1089 of file error.c.

Referenced by rb_alias_variable(), rb_current_receiver(), rb_memory_view_prepare_item_desc(), rb_reg_regsub(), rb_str_dump(), rb_str_set_len(), rb_str_unlocktmp(), rb_tracearg_object(), rb_tracearg_raised_exception(), and rb_tracearg_return_value().

## ◆ rb_eScriptError [1/2]

VALUE rb_eScriptError

`ScriptError` exception.

Definition at line 1107 of file error.c.

## ◆ rb_eScriptError [2/2]

VALUE rb_eScriptError
| extern

`ScriptError` exception.

Definition at line 1107 of file error.c.

## ◆ rb_eSecurityError [1/2]

VALUE rb_eSecurityError

`SecurityError` exception.

Definition at line 1100 of file error.c.

## ◆ rb_eSecurityError [2/2]

VALUE rb_eSecurityError
| extern

`SecurityError` exception.

Definition at line 1100 of file error.c.

## ◆ rb_eSignal [1/2]

VALUE rb_eSignal

`SignalException` exception.

Definition at line 1086 of file error.c.

## ◆ rb_eSignal [2/2]

VALUE rb_eSignal
| extern

`SignalException` exception.

Definition at line 1086 of file error.c.

## ◆ rb_eStandardError [1/2]

VALUE rb_eStandardError

`StandardError` exception.

Definition at line 1088 of file error.c.

Referenced by rb_rescue().

## ◆ rb_eStandardError [2/2]

VALUE rb_eStandardError
| extern

`StandardError` exception.

Definition at line 1088 of file error.c.

Referenced by rb_rescue().

## ◆ rb_eStopIteration

VALUE rb_eStopIteration
| extern

`StopIteration` exception.

Definition at line 176 of file enumerator.c.

## ◆ rb_eSyntaxError [1/2]

VALUE rb_eSyntaxError

`SyntaxError` exception.

Definition at line 1108 of file error.c.

## ◆ rb_eSyntaxError [2/2]

VALUE rb_eSyntaxError
| extern

`SyntaxError` exception.

Definition at line 1108 of file error.c.

## ◆ rb_eSysStackError

VALUE rb_eSysStackError
| extern

`SystemStackError` exception.

Definition at line 50 of file eval.c.

## ◆ rb_eSystemCallError [1/2]

VALUE rb_eSystemCallError

`SystemCallError` exception.

Definition at line 1111 of file error.c.

## ◆ rb_eSystemCallError [2/2]

VALUE rb_eSystemCallError
| extern

`SystemCallError` exception.

Definition at line 1111 of file error.c.

## ◆ rb_eSystemExit [1/2]

VALUE rb_eSystemExit

`SystemExit` exception.

Definition at line 1084 of file error.c.

Referenced by rb_exit(), and rb_f_abort().

## ◆ rb_eSystemExit [2/2]

VALUE rb_eSystemExit
| extern

`SystemExit` exception.

Definition at line 1084 of file error.c.

Referenced by rb_exit(), and rb_f_abort().

## ◆ rb_eThreadError

VALUE rb_eThreadError
| extern

`ThreadError` exception.

Definition at line 886 of file eval.c.

Referenced by rb_mutex_unlock(), rb_thread_stop(), and rb_thread_wakeup().

## ◆ rb_eTypeError [1/2]

VALUE rb_eTypeError

`TypeError` exception.

Definition at line 1091 of file error.c.

Referenced by rb_alias(), rb_check_id(), rb_check_inheritable(), rb_check_symbol(), rb_check_typeddata(), rb_class_attached_object(), rb_class_inherited_p(), rb_class_superclass(), rb_define_class(), rb_define_module(), rb_define_module_id_under(), rb_Hash(), rb_method_call_with_block_kw(), rb_must_asciicompat(), rb_num2dbl(), rb_num2long(), rb_obj_encoding(), rb_obj_init_copy(), rb_obj_is_kind_of(), rb_path_to_class(), rb_set_errinfo(), rb_struct_members(), rb_struct_s_members(), rb_sym2id(), and rb_undef().

## ◆ rb_eTypeError [2/2]

VALUE rb_eTypeError
| extern

`TypeError` exception.

Definition at line 1091 of file error.c.

Referenced by rb_alias(), rb_check_id(), rb_check_inheritable(), rb_check_symbol(), rb_check_typeddata(), rb_class_attached_object(), rb_class_inherited_p(), rb_class_superclass(), rb_define_class(), rb_define_module(), rb_define_module_id_under(), rb_Hash(), rb_method_call_with_block_kw(), rb_must_asciicompat(), rb_num2dbl(), rb_num2long(), rb_obj_encoding(), rb_obj_init_copy(), rb_obj_is_kind_of(), rb_path_to_class(), rb_set_errinfo(), rb_struct_members(), rb_struct_s_members(), rb_sym2id(), and rb_undef().

## ◆ rb_eZeroDivError

VALUE rb_eZeroDivError
| extern

`ZeroDivisionError` exception.

Definition at line 194 of file numeric.c.

Referenced by rb_num_zerodiv().

## ◆ rb_mErrno

VALUE rb_mErrno

`Errno` module.

Definition at line 1112 of file error.c.

## ◆ rb_mWarning

VALUE rb_mWarning
| static

Definition at line 73 of file error.c.

## ◆ ruby_static_id_cause

ID ruby_static_id_cause

Definition at line 1115 of file error.c.

## ◆ sym_category

VALUE sym_category
| static

Definition at line 80 of file error.c.

## ◆ sym_highlight

VALUE sym_highlight
| static

Definition at line 81 of file error.c.

## ◆ syserr_tbl

st_table* syserr_tbl
| static

Definition at line 2401 of file error.c.

## ◆ warning_disabled_categories

unsigned int warning_disabled_categories
| static

Initial value:
= (
1U << RB_WARN_CATEGORY_DEPRECATED |
0)
RB_WARN_CATEGORY_DEPRECATED
@ RB_WARN_CATEGORY_DEPRECATED
Warning is for deprecated features.
Definition error.h:48

Definition at line 150 of file error.c.