Ruby: Exception handlings

Ruby 3.4.3p32 (2025-04-14 revision d0b7e5b6a04bde21ca483d20a1546b28b401c2d4)

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

## Data Structures
struct | bug_reporters
struct | path_string
struct | report_expansion
struct | name_error_message_struct

## Macros
#define | EXIT_SUCCESS 0
#define | WIFEXITED(status)
#define | WEXITSTATUS(status)
#define | with_warn_vsprintf(enc, 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 | 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.

## Typedefs
typedef struct name_error_message_struct | name_error_message_t

## Enumerations
enum | rb_warning_category_t { RB_WARN_CATEGORY_NONE , RB_WARN_CATEGORY_DEPRECATED , RB_WARN_CATEGORY_EXPERIMENTAL , RB_WARN_CATEGORY_PERFORMANCE , RB_WARN_CATEGORY_STRICT_UNUSED_BLOCK , RB_WARN_CATEGORY_DEFAULT_BITS , RB_WARN_CATEGORY_ALL_BITS }
| 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_categories (VALUE mod)
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 unless $VERBOSE is nil.
void | rb_enc_compile_warn (rb_encoding *enc, const char *file, int line, const char *fmt,...)
void | rb_compile_warning (const char *file, int line, const char *fmt,...)
| Issues a compile-time warning that happens at `__file__:__line__`.
void | rb_enc_compile_warning (rb_encoding *enc, const char *file, int line, const char *fmt,...)
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 unless $VERBOSE is nil.
void | rb_category_warn (rb_warning_category_t cat, const char *fmt,...)
| Identical to rb_category_warning(), except it reports unless $VERBOSE is nil.
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,...)
void | rb_warn_reserved_name (const char *coming, const char *fmt,...)
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 bool | path_sep_p (char x)
static char * | append_pathname (char *p, const char *pe, VALUE str)
static char * | append_basename (char *p, const char *pe, struct path_string *path, VALUE str)
static void | finish_report (FILE *out, rb_pid_t pid)
static char * | expand_report_argument (const char **input_template, struct report_expansion *values, char *buf, size_t size, bool word)
FILE * | ruby_popen_writer (char *const *argv, rb_pid_t *pid)
static FILE * | open_report_path (const char *template, char *buf, size_t size, rb_pid_t *pid)
static FILE * | bug_report_file (const char *file, int line, rb_pid_t *pid)
| 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, rb_pid_t pid)
void | ruby_set_crash_report (const char *template)
static void | die (void)
static void | rb_bug_without_die_internal (const char *fmt, va_list args)
void | rb_bug_without_die (const char *fmt,...)
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)
void | rb_assert_failure_detail (const char *file, int line, const char *name, const char *expr, const char *fmt,...)
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 void | name_err_mesg_update (void *p)
static VALUE | rb_name_err_mesg_init (VALUE klass, VALUE mesg, VALUE recv, VALUE name)
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)
void | rb_free_warning (void)
static VALUE | setup_syserr (int n, const char *name)
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 (ID key, VALUE 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)
static VALUE | get_created_info (VALUE obj, int *pline)
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_warn_unchilled_literal (VALUE obj)
void | rb_warn_unchilled_symbol_to_s (VALUE obj)
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 ID | id_performance
static ID | id_strict_unused_block
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 | PATHSEP_REPLACE = '!'
static const char * | crash_report
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 1017 of file error.c.

## ◆ EXIT_SUCCESS

#define EXIT_SUCCESS 0

Definition at line 62 of file error.c.

## ◆ frozen_err_receiver

#define frozen_err_receiver name_err_receiver

Definition at line 2341 of file error.c.

## ◆ id_bt

#define id_bt idBt

Definition at line 1460 of file error.c.

## ◆ id_bt_locations

#define id_bt_locations idBt_locations

Definition at line 1461 of file error.c.

## ◆ id_cause

#define id_cause ruby_static_id_cause

Definition at line 1455 of file error.c.

## ◆ id_mesg

#define id_mesg idMesg

Definition at line 1462 of file error.c.

## ◆ id_name

#define id_name idName

Definition at line 1463 of file error.c.

## ◆ MAX_BUG_REPORTERS

#define MAX_BUG_REPORTERS 0x100

Definition at line 663 of file error.c.

## ◆ report_bug

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

Value:
do { \
rb_pid_t pid = -1; \
FILE *out = bug_report_file(file, line, &pid); \
if (out) { \
bug_report_begin(out, fmt); \
rb_vm_bugreport(ctx, out); \
bug_report_end(out, pid); \
} \
} while (0) \

Definition at line 1039 of file error.c.

## ◆ REPORT_BUG_BUFSIZ

#define REPORT_BUG_BUFSIZ 256

Definition at line 900 of file error.c.

## ◆ report_bug_valist

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

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

Definition at line 1049 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 486 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 475 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 1313 of file error.c.

## ◆ WEXITSTATUS

#define WEXITSTATUS | ( |  | status | ) |

Value:
(status)

Definition at line 70 of file error.c.

## ◆ WIFEXITED

#define WIFEXITED | ( |  | status | ) |

Value:
1

Definition at line 66 of file error.c.

## ◆ with_warn_vsprintf

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

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

Definition at line 389 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 457 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 459 of file error.c.

## ◆ WRITE_CONST

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

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

Definition at line 1158 of file error.c.

## ◆ write_or_abort

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

Value:
(write((fd), (str), (len)) < 0 ? abort() : (void)0)
len
int len
Length of the buffer.
Definition io.h:8

Definition at line 1157 of file error.c.

## Enumeration Type Documentation

## ◆ rb_io_wait_readwrite

enum rb_io_wait_readwrite

for rb_readwrite_sys_fail first argument

Definition at line 73 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.
RB_WARN_CATEGORY_PERFORMANCE | Warning is for performance issues (not enabled by -w).
RB_WARN_CATEGORY_STRICT_UNUSED_BLOCK | Warning is for checking unused block strictly.

Definition at line 43 of file error.h.

## Function Documentation

## ◆ append_basename()

static char * append_basename | ( | char * | p,
|  | const char * | pe,
|  | struct path_string * | path,
|  | VALUE | str )
| static

Definition at line 747 of file error.c.

## ◆ append_pathname()

static char * append_pathname | ( | char * | p,
|  | const char * | pe,
|  | VALUE | str )
| static

Definition at line 707 of file error.c.

## ◆ bug_important_message()

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

Definition at line 927 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 1005 of file error.c.

## ◆ bug_report_end()

static void bug_report_end | ( | FILE * | out,
|  | rb_pid_t | pid )
| static

Definition at line 1025 of file error.c.

## ◆ bug_report_file()

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

Definition at line 902 of file error.c.

## ◆ builtin_class_name()

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

Definition at line 1276 of file error.c.

## ◆ check_highlight_keyword()

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

Definition at line 1626 of file error.c.

## ◆ check_order_keyword()

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

Definition at line 1649 of file error.c.

## ◆ deprecation_warning_enabled()

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

Definition at line 538 of file error.c.

## ◆ die()

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

Definition at line 1077 of file error.c.

## ◆ displaying_class_of()

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

Definition at line 1265 of file error.c.

## ◆ end_with_asciichar()

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

Definition at line 591 of file error.c.

## ◆ err_init_recv()

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

Definition at line 2301 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 110 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 125 of file error.c.

## ◆ exc_backtrace()

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

Definition at line 1897 of file error.c.

## ◆ exc_backtrace_locations()

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

Definition at line 1973 of file error.c.

## ◆ exc_cause()

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

Definition at line 2161 of file error.c.

## ◆ exc_detailed_message()

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

Definition at line 1809 of file error.c.

## ◆ exc_equal()

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

Definition at line 2182 of file error.c.

## ◆ exc_exception()

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

Definition at line 1552 of file error.c.

## ◆ exc_full_message()

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

Definition at line 1725 of file error.c.

## ◆ exc_init()

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

Definition at line 1489 of file error.c.

## ◆ exc_initialize()

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

Definition at line 1518 of file error.c.

## ◆ exc_inspect()

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

Definition at line 1836 of file error.c.

## ◆ exc_message()

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

Definition at line 1758 of file error.c.

## ◆ exc_s_to_tty_p()

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

Definition at line 1620 of file error.c.

## ◆ exc_set_backtrace()

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

Definition at line 2109 of file error.c.

## ◆ exc_to_s()

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

Definition at line 1578 of file error.c.

## ◆ exception_alloc()

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

Definition at line 3549 of file error.c.

## ◆ exception_dumper()

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

Definition at line 3555 of file error.c.

## ◆ exception_loader()

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

Definition at line 3574 of file error.c.

## ◆ exit_initialize()

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

Definition at line 2225 of file error.c.

## ◆ exit_status()

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

Definition at line 2275 of file error.c.

## ◆ exit_success_p()

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

Definition at line 2289 of file error.c.

## ◆ expand_report_argument()

static char * expand_report_argument | ( | const char ** | input_template,
|  | struct report_expansion * | values,
|  | char * | buf,
|  | size_t | size,
|  | bool | word )
| static

Definition at line 813 of file error.c.

## ◆ finish_report()

static void finish_report | ( | FILE * | out,
|  | rb_pid_t | pid )
| static

Definition at line 780 of file error.c.

## ◆ frozen_err_initialize()

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

Definition at line 2320 of file error.c.

## ◆ get_created_info()

static VALUE get_created_info | ( | VALUE | obj,
|  | int * | pline )
| static

Definition at line 4115 of file error.c.

## ◆ get_syserr()

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

Definition at line 3080 of file error.c.

## ◆ Init_Exception()

void Init_Exception | ( | void |  | ) |

Definition at line 3597 of file error.c.

## ◆ Init_syserr()

void Init_syserr | ( | void |  | ) |

Definition at line 4205 of file error.c.

## ◆ inspect_frozen_obj()

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

Definition at line 4103 of file error.c.

## ◆ ivar_copy_i()

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

Definition at line 3565 of file error.c.

## ◆ key_err_initialize()

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

Definition at line 2844 of file error.c.

## ◆ key_err_key()

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

Definition at line 2815 of file error.c.

## ◆ key_err_receiver()

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

Definition at line 2798 of file error.c.

## ◆ make_errno_exc()

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

Definition at line 3837 of file error.c.

## ◆ make_errno_exc_str()

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

Definition at line 3849 of file error.c.

## ◆ name_err_init()

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

Definition at line 2418 of file error.c.

## ◆ name_err_init_attr()

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

Definition at line 2374 of file error.c.

## ◆ name_err_initialize()

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

Definition at line 2401 of file error.c.

## ◆ name_err_local_variables()

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

Definition at line 2455 of file error.c.

## ◆ name_err_mesg_alloc()

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

Definition at line 2569 of file error.c.

## ◆ name_err_mesg_dump()

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

Definition at line 2720 of file error.c.

## ◆ name_err_mesg_equal()

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

Definition at line 2593 of file error.c.

## ◆ name_err_mesg_init_copy()

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

Definition at line 2576 of file error.c.

## ◆ name_err_mesg_load()

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

Definition at line 2727 of file error.c.

## ◆ name_err_mesg_mark()

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

Definition at line 2520 of file error.c.

## ◆ name_err_mesg_receiver_name()

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

Definition at line 2612 of file error.c.

## ◆ name_err_mesg_to_str()

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

Definition at line 2623 of file error.c.

## ◆ name_err_mesg_update()

static void name_err_mesg_update | ( | void * | p | ) |
| static

Definition at line 2529 of file error.c.

## ◆ name_err_name()

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

Definition at line 2439 of file error.c.

## ◆ name_err_receiver()

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

Definition at line 2740 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 2910 of file error.c.

## ◆ no_matching_pattern_key_err_key()

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

Definition at line 2892 of file error.c.

## ◆ no_matching_pattern_key_err_matchee()

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

Definition at line 2875 of file error.c.

## ◆ nometh_err_args()

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

Definition at line 2764 of file error.c.

## ◆ nometh_err_init_attr()

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

Definition at line 2469 of file error.c.

## ◆ nometh_err_initialize()

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

Definition at line 2493 of file error.c.

## ◆ nometh_err_private_call_p()

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

Definition at line 2777 of file error.c.

## ◆ open_report_path()

static FILE * open_report_path | ( | const char * | template,
|  | char * | buf,
|  | size_t | size,
|  | rb_pid_t * | pid )
| static

Definition at line 870 of file error.c.

## ◆ path_sep_p()

static bool path_sep_p | ( | char | x | ) |
| static

Definition at line 688 of file error.c.

## ◆ postscript_dump()

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

Definition at line 982 of file error.c.

## ◆ preface_dump()

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

Definition at line 957 of file error.c.

## ◆ raise_loaderror()

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

Definition at line 3776 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 1189 of file error.c.

## ◆ rb_assert_failure_detail()

void rb_assert_failure_detail | ( | const char * | file,
|  | int | line,
|  | const char * | name,
|  | const char * | expr,
|  | const char * | fmt,
|  |  | ... )

Definition at line 1195 of file error.c.

## ◆ rb_async_bug_errno()

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

Definition at line 1161 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 1111 of file error.c.

## ◆ 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 1140 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 1121 of file error.c.

## ◆ rb_bug_reporter_add()

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

Definition at line 673 of file error.c.

## ◆ rb_bug_without_die()

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

Definition at line 1102 of file error.c.

## ◆ rb_bug_without_die_internal()

static void rb_bug_without_die_internal | ( | const char * | fmt,
|  | va_list | args )
| static

Definition at line 1088 of file error.c.

## ◆ rb_builtin_class_name()

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

Definition at line 1302 of file error.c.

## ◆ rb_builtin_type_name()

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

Definition at line 1255 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 439 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 unless $VERBOSE is nil.

Parameters

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

Definition at line 476 of file error.c.

Referenced by rb_io_print(), and ruby_process_options().

## ◆ 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 508 of file error.c.

## ◆ rb_check_backtrace()

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

Definition at line 1985 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 4197 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 4191 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 1337 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 1397 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 unless $VERBOSE is nil.

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 397 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 value of $VERBOSE.

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 418 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 974 of file vm_backtrace.c.

## ◆ rb_enc_compile_warn()

void rb_enc_compile_warn | ( | rb_encoding * | enc,
|  | const char * | file,
|  | int | line,
|  | const char * | fmt,
|  |  | ... )

Definition at line 407 of file error.c.

## ◆ rb_enc_compile_warning()

void rb_enc_compile_warning | ( | rb_encoding * | enc,
|  | const char * | file,
|  | int | line,
|  | const char * | fmt,
|  |  | ... )

Definition at line 429 of file error.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 3745 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 486 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 1066 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 1941 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 4083 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 4129 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 313 of file eval_error.c.

## ◆ rb_exc_check_circular_cause()

void rb_exc_check_circular_cause | ( | VALUE | exc | ) |

Definition at line 302 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 689 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 1468 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 1475 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 1481 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 676 of file eval.c.

## ◆ rb_exc_set_backtrace()

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

Definition at line 2123 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 4457 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 3816 of file error.c.

## ◆ rb_free_warning()

void rb_free_warning | ( | void |  | ) |

Definition at line 3030 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 4089 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 1914 of file error.c.

## ◆ rb_get_detailed_message()

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

Definition at line 1599 of file error.c.

## ◆ rb_get_message()

VALUE rb_get_message | ( | VALUE | exc | ) |

Definition at line 1590 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 2783 of file error.c.

Referenced by rb_cstr_to_inum().

## ◆ rb_iseqw_local_variables()

VALUE rb_iseqw_local_variables | ( | VALUE | iseqval | ) |

Definition at line 4119 of file iseq.c.

## ◆ rb_iseqw_new()

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

Definition at line 1532 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 2085 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 2091 of file vm.c.

## ◆ rb_key_err_new()

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

Definition at line 2825 of file error.c.

## ◆ rb_load_fail()

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

Definition at line 4074 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 3784 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 3796 of file error.c.

## ◆ rb_mod_exc_raise()

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

Definition at line 3939 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 3946 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 3953 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 3960 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 3967 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 | name )
| static

Definition at line 2550 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 2562 of file error.c.

## ◆ rb_name_err_new()

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

Definition at line 2425 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 2344 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 2359 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 2506 of file error.c.

## ◆ rb_notimplement()

void rb_notimplement | ( | void |  | ) |

Exceptions

  rb_eNotImpError |

Note
  It never returns.

Definition at line 3808 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 3764 of file error.c.

## ◆ 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 14662 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 14668 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 1183 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:966
rb_eStandardError
VALUE rb_eStandardError
StandardError exception.
Definition error.c:1427

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 1037 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 966 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 1947 of file eval.c.

## ◆ rb_str_end_with_asciichar()

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

Definition at line 8883 of file io.c.

## ◆ rb_strerrno()

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

Definition at line 99 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 141 of file error.c.

## ◆ rb_sys_enc_warning()

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

Definition at line 4052 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:3890
StringValueCStr
#define StringValueCStr(v)
Identical to StringValuePtr, except it additionally checks for the contents for viability as a C stri...
Definition rstring.h:89

Parameters

  [in] | msg | Additional message to raise.

Exceptions

  rb_eSystemCallError | An exception representing errno.

Note
  It never returns.

Definition at line 3890 of file error.c.

## ◆ 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 3897 of file error.c.

## ◆ 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 value of $VERBOSE.

Parameters

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

Definition at line 4028 of file error.c.

## ◆ rb_syserr_enc_warning()

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

Definition at line 4064 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 3877 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 3883 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 3863 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 3871 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 1370 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 1391 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 1380 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 1360 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 3758 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 977 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 unless $VERBOSE is nil.

Note
  This function is affected by the value of $VERBOSE, it does nothing if $VERBOSE is nil.

Parameters

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

Definition at line 466 of file error.c.

Referenced by rb_complex_pow(), rb_define_const(), rb_enc_find_index(), rb_fdopen(), rb_gc_register_address(), 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 355 of file error.c.

## ◆ rb_warn_deprecated()

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

Definition at line 559 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 569 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 610 of file error.c.

## ◆ rb_warn_reserved_name()

void rb_warn_reserved_name | ( | const char * | coming,
|  | const char * | fmt,
|  |  | ... )

Definition at line 579 of file error.c.

## ◆ rb_warn_unchilled_literal()

void rb_warn_unchilled_literal | ( | VALUE | obj | ) |

Definition at line 4149 of file error.c.

## ◆ rb_warn_unchilled_symbol_to_s()

void rb_warn_unchilled_symbol_to_s | ( | VALUE | obj | ) |

Definition at line 4181 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 value of $VERBOSE, it does nothing unless $VERBOSE is true.

Parameters

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

Definition at line 497 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 201 of file error.c.

## ◆ rb_warning_category_from_name()

rb_warning_category_t rb_warning_category_from_name | ( | VALUE | category | ) |

Definition at line 171 of file error.c.

## ◆ rb_warning_category_mask()

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

Definition at line 165 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 184 of file error.c.

## ◆ rb_warning_category_update()

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

Definition at line 194 of file error.c.

## ◆ rb_warning_s_aref()

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

Definition at line 228 of file error.c.

## ◆ rb_warning_s_aset()

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

Definition at line 243 of file error.c.

## ◆ rb_warning_s_categories()

static VALUE rb_warning_s_categories | ( | VALUE | mod | ) |
| static

Definition at line 263 of file error.c.

## ◆ rb_warning_s_warn()

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

Definition at line 287 of file error.c.

## ◆ rb_warning_string()

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

Definition at line 518 of file error.c.

## ◆ rb_warning_warn()

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

Definition at line 341 of file error.c.

## ◆ rb_warning_warn_arity()

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

Definition at line 348 of file error.c.

## ◆ rb_write_warning_str()

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

Definition at line 374 of file error.c.

## ◆ ruby_popen_writer()

FILE * ruby_popen_writer | ( | char *const * | argv,
|  | rb_pid_t * | pid )

Definition at line 8080 of file io.c.

## ◆ ruby_set_crash_report()

void ruby_set_crash_report | ( | const char * | template | ) |

Definition at line 1060 of file error.c.

## ◆ set_syserr()

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

Definition at line 3065 of file error.c.

## ◆ setup_syserr()

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

Definition at line 3038 of file error.c.

## ◆ syntax_error_initialize()

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

Definition at line 2942 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 2954 of file error.c.

## ◆ syserr_eqq()

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

Definition at line 3168 of file error.c.

## ◆ syserr_errno()

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

Definition at line 3154 of file error.c.

## ◆ syserr_initialize()

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

Definition at line 3104 of file error.c.

## ◆ syserr_warning()

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

Definition at line 3974 of file error.c.

## ◆ try_convert_to_exception()

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

Definition at line 2167 of file error.c.

## ◆ unexpected_type()

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

Definition at line 1316 of file error.c.

## ◆ warn_deprecated()

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

Definition at line 546 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 381 of file error.c.

## ◆ warning_string()

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

Definition at line 450 of file error.c.

## ◆ warning_write()

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

Definition at line 599 of file error.c.

## Variable Documentation

## ◆ bug_reporters_size

int bug_reporters_size
| static

Definition at line 670 of file error.c.

## ◆ builtin_types

const char builtin_types[][10]
| static

Definition at line 1222 of file error.c.

## ◆ crash_report

const char* crash_report
| static

Definition at line 897 of file error.c.

## ◆ []

st_table * { ... } ::enum2id

Definition at line 93 of file error.c.

## ◆ []

st_table* { ... } ::id2enum

Definition at line 93 of file error.c.

## ◆ id_args

ID id_args
| static

Definition at line 1457 of file error.c.

## ◆ id_backtrace

ID id_backtrace
| static

Definition at line 1456 of file error.c.

## ◆ id_bottom

ID id_bottom
| static

Definition at line 1459 of file error.c.

## ◆ id_category

ID id_category
| static

Definition at line 85 of file error.c.

## ◆ id_deprecated

ID id_deprecated
| static

Definition at line 86 of file error.c.

## ◆ id_detailed_message

ID id_detailed_message
| static

Definition at line 1456 of file error.c.

## ◆ id_Errno

ID id_Errno
| static

Definition at line 1457 of file error.c.

## ◆ id_errno

ID id_errno
| static

Definition at line 1457 of file error.c.

## ◆ id_experimental

ID id_experimental
| static

Definition at line 87 of file error.c.

## ◆ id_i_path

ID id_i_path
| static

Definition at line 1457 of file error.c.

## ◆ id_iseq

ID id_iseq
| static

Definition at line 1458 of file error.c.

## ◆ id_key

ID id_key
| static

Definition at line 1457 of file error.c.

## ◆ id_local_variables

ID id_local_variables
| static

Definition at line 1458 of file error.c.

## ◆ id_matchee

ID id_matchee
| static

Definition at line 1457 of file error.c.

## ◆ id_message

ID id_message
| static

Definition at line 1456 of file error.c.

## ◆ id_performance

ID id_performance
| static

Definition at line 88 of file error.c.

## ◆ id_private_call_p

ID id_private_call_p
| static

Definition at line 1459 of file error.c.

## ◆ id_receiver

ID id_receiver
| static

Definition at line 1458 of file error.c.

## ◆ id_recv

ID id_recv
| static

Definition at line 1458 of file error.c.

## ◆ id_strict_unused_block

ID id_strict_unused_block
| static

Definition at line 89 of file error.c.

## ◆ id_top

ID id_top
| static

Definition at line 1459 of file error.c.

## ◆ id_warn

ID id_warn
| static

Definition at line 84 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,
RUBY_TYPED_DEFAULT_FREE,
NULL,
name_err_mesg_update,
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY | RUBY_TYPED_WB_PROTECTED | RUBY_TYPED_EMBEDDABLE
}
RUBY_TYPED_DEFAULT_FREE
#define RUBY_TYPED_DEFAULT_FREE
This is a value you can set to rb_data_type_struct::dfree.
Definition rtypeddata.h:79

Definition at line 2537 of file error.c.

## ◆ PATHSEP_REPLACE

const char PATHSEP_REPLACE = '!'
| static

Definition at line 704 of file error.c.

## ◆ rb_backtrace_length_limit

long rb_backtrace_length_limit = -1

Definition at line 77 of file error.c.

## ◆ rb_cNameErrorMesg

VALUE rb_cNameErrorMesg

`NameError::Message` class.

Definition at line 1442 of file error.c.

## ◆ rb_cWarningBuffer

VALUE rb_cWarningBuffer
| static

Definition at line 82 of file error.c.

## ◆ rb_dynamic_description

const char* rb_dynamic_description
| extern

Definition at line 88 of file version.c.

## ◆ rb_eArgError [1/2]

VALUE rb_eArgError

`ArgumentError` exception.

Definition at line 1431 of file error.c.

## ◆ rb_eArgError [2/2]

VALUE rb_eArgError
| extern

`ArgumentError` exception.

Definition at line 1431 of file error.c.

## ◆ rb_eEAGAIN

VALUE rb_eEAGAIN

Definition at line 78 of file error.c.

## ◆ rb_eEINPROGRESS

VALUE rb_eEINPROGRESS

Definition at line 80 of file error.c.

## ◆ rb_eEncCompatError [1/2]

VALUE rb_eEncCompatError

`Encoding::CompatibilityError` exception.

Definition at line 1437 of file error.c.

Referenced by rb_must_asciicompat().

## ◆ rb_eEncCompatError [2/2]

VALUE rb_eEncCompatError
| extern

`Encoding::CompatibilityError` exception.

Definition at line 1437 of file error.c.

Referenced by rb_must_asciicompat().

## ◆ rb_eEncodingError [1/2]

VALUE rb_eEncodingError

`EncodingError` exception.

Definition at line 1436 of file error.c.

## ◆ rb_eEncodingError [2/2]

VALUE rb_eEncodingError
| extern

`EncodingError` exception.

Definition at line 1436 of file error.c.

## ◆ rb_eEOFError

VALUE rb_eEOFError
| extern

`EOFError` exception.

Definition at line 188 of file io.c.

Referenced by rb_eof_error().

## ◆ rb_eEWOULDBLOCK

VALUE rb_eEWOULDBLOCK

Definition at line 79 of file error.c.

## ◆ rb_eException [1/2]

VALUE rb_eException

Mother of all exceptions.

Definition at line 1422 of file error.c.

Referenced by rb_set_errinfo().

## ◆ rb_eException [2/2]

VALUE rb_eException
| extern

Mother of all exceptions.

Definition at line 1422 of file error.c.

Referenced by rb_set_errinfo().

## ◆ rb_eFatal [1/2]

VALUE rb_eFatal

`fatal` exception.

Definition at line 1426 of file error.c.

Referenced by rb_fatal().

## ◆ rb_eFatal [2/2]

VALUE rb_eFatal
| extern

`fatal` exception.

Definition at line 1426 of file error.c.

Referenced by rb_fatal().

## ◆ rb_eFloatDomainError

VALUE rb_eFloatDomainError
| extern

`FloatDomainError` exception.

Definition at line 201 of file numeric.c.

## ◆ rb_eFrozenError [1/2]

VALUE rb_eFrozenError

`FrozenError` exception.

Definition at line 1429 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 1429 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 1432 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 1432 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 1424 of file error.c.

Referenced by rb_interrupt().

## ◆ rb_eInterrupt [2/2]

VALUE rb_eInterrupt
| extern

`Interrupt` exception.

Definition at line 1424 of file error.c.

Referenced by rb_interrupt().

## ◆ rb_eIOError

VALUE rb_eIOError
| extern

`IOError` exception.

Definition at line 189 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 1433 of file error.c.

## ◆ rb_eKeyError [2/2]

VALUE rb_eKeyError
| extern

`KeyError` exception.

Definition at line 1433 of file error.c.

## ◆ rb_eLoadError [1/2]

VALUE rb_eLoadError

`LoadError` exception.

Definition at line 1448 of file error.c.

## ◆ rb_eLoadError [2/2]

VALUE rb_eLoadError
| extern

`LoadError` exception.

Definition at line 1448 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 1435 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 1435 of file error.c.

Referenced by rb_name_error(), and rb_name_error_str().

## ◆ rb_eNOERROR

VALUE rb_eNOERROR
| static

Definition at line 1452 of file error.c.

## ◆ rb_eNoMatchingPatternError [1/2]

VALUE rb_eNoMatchingPatternError

`NoMatchingPatternError` exception.

Definition at line 1443 of file error.c.

## ◆ rb_eNoMatchingPatternError [2/2]

VALUE rb_eNoMatchingPatternError
| extern

`NoMatchingPatternError` exception.

Definition at line 1443 of file error.c.

## ◆ rb_eNoMatchingPatternKeyError [1/2]

VALUE rb_eNoMatchingPatternKeyError

`NoMatchingPatternKeyError` exception.

Definition at line 1444 of file error.c.

## ◆ rb_eNoMatchingPatternKeyError [2/2]

VALUE rb_eNoMatchingPatternKeyError
| extern

`NoMatchingPatternKeyError` exception.

Definition at line 1444 of file error.c.

## ◆ rb_eNoMemError [1/2]

VALUE rb_eNoMemError

`NoMemoryError` exception.

Definition at line 1441 of file error.c.

## ◆ rb_eNoMemError [2/2]

VALUE rb_eNoMemError
| extern

`NoMemoryError` exception.

Definition at line 1441 of file error.c.

## ◆ rb_eNoMethodError [1/2]

VALUE rb_eNoMethodError

`NoMethodError` exception.

Definition at line 1438 of file error.c.

## ◆ rb_eNoMethodError [2/2]

VALUE rb_eNoMethodError
| extern

`NoMethodError` exception.

Definition at line 1438 of file error.c.

## ◆ rb_eNotImpError [1/2]

VALUE rb_eNotImpError

`NotImplementedError` exception.

Definition at line 1440 of file error.c.

Referenced by rb_notimplement().

## ◆ rb_eNotImpError [2/2]

VALUE rb_eNotImpError
| extern

`NotImplementedError` exception.

Definition at line 1440 of file error.c.

Referenced by rb_notimplement().

## ◆ rb_eRangeError [1/2]

VALUE rb_eRangeError

`RangeError` exception.

Definition at line 1434 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 1434 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 1428 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 1428 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 1446 of file error.c.

## ◆ rb_eScriptError [2/2]

VALUE rb_eScriptError
| extern

`ScriptError` exception.

Definition at line 1446 of file error.c.

## ◆ rb_eSecurityError [1/2]

VALUE rb_eSecurityError

`SecurityError` exception.

Definition at line 1439 of file error.c.

## ◆ rb_eSecurityError [2/2]

VALUE rb_eSecurityError
| extern

`SecurityError` exception.

Definition at line 1439 of file error.c.

## ◆ rb_eSignal [1/2]

VALUE rb_eSignal

`SignalException` exception.

Definition at line 1425 of file error.c.

## ◆ rb_eSignal [2/2]

VALUE rb_eSignal
| extern

`SignalException` exception.

Definition at line 1425 of file error.c.

## ◆ rb_eStandardError [1/2]

VALUE rb_eStandardError

`StandardError` exception.

Definition at line 1427 of file error.c.

Referenced by rb_rescue().

## ◆ rb_eStandardError [2/2]

VALUE rb_eStandardError
| extern

`StandardError` exception.

Definition at line 1427 of file error.c.

Referenced by rb_rescue().

## ◆ rb_eStopIteration

VALUE rb_eStopIteration
| extern

`StopIteration` exception.

Definition at line 181 of file enumerator.c.

## ◆ rb_eSyntaxError [1/2]

VALUE rb_eSyntaxError

`SyntaxError` exception.

Definition at line 1447 of file error.c.

## ◆ rb_eSyntaxError [2/2]

VALUE rb_eSyntaxError
| extern

`SyntaxError` exception.

Definition at line 1447 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 1450 of file error.c.

## ◆ rb_eSystemCallError [2/2]

VALUE rb_eSystemCallError
| extern

`SystemCallError` exception.

Definition at line 1450 of file error.c.

## ◆ rb_eSystemExit [1/2]

VALUE rb_eSystemExit

`SystemExit` exception.

Definition at line 1423 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 1423 of file error.c.

Referenced by rb_exit(), and rb_f_abort().

## ◆ rb_eThreadError

VALUE rb_eThreadError
| extern

`ThreadError` exception.

Definition at line 955 of file eval.c.

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

## ◆ rb_eTypeError [1/2]

VALUE rb_eTypeError

`TypeError` exception.

Definition at line 1430 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_data_typed_object_wrap(), rb_data_typed_object_zalloc(), rb_define_class(), rb_define_module(), rb_define_module_id_under(), rb_gc_latest_gc_info(), rb_gc_stat(), rb_Hash(), rb_io_descriptor(), 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 1430 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_data_typed_object_wrap(), rb_data_typed_object_zalloc(), rb_define_class(), rb_define_module(), rb_define_module_id_under(), rb_gc_latest_gc_info(), rb_gc_stat(), rb_Hash(), rb_io_descriptor(), 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 200 of file numeric.c.

Referenced by rb_num_zerodiv().

## ◆ rb_mErrno

VALUE rb_mErrno

`Errno` module.

Definition at line 1451 of file error.c.

## ◆ rb_mWarning

VALUE rb_mWarning
| static

Definition at line 81 of file error.c.

## ◆ ruby_static_id_cause

ID ruby_static_id_cause

Definition at line 1454 of file error.c.

## ◆ sym_category

VALUE sym_category
| static

Definition at line 90 of file error.c.

## ◆ sym_highlight

VALUE sym_highlight
| static

Definition at line 91 of file error.c.

## ◆ syserr_tbl

st_table* syserr_tbl
| static

Definition at line 3027 of file error.c.

## ◆ warning_disabled_categories

unsigned int warning_disabled_categories
| static

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

Definition at line 160 of file error.c.