Header: mruby/error.h

Overview

mruby error handling.

Function Summary collapse

Define Summary

#define MRUBY_ERROR_H
#define MRB_EXC_EXIT

error that should terminate execution

#define MRB_EXC_EXIT_P
#define MRB_EXC_EXIT_STATUS

retrieve status value from exc; need <mruby/variable.h> and <mruby/presym.h>

#define MRB_EXC_CHECK_EXIT

exit with SystemExit status

#define mrb_exc_ptr
#define mrb_exc_new_lit
#define MRB_USE_RBREAK_VALUE_UNION
#define mrb_break_value_get
#define mrb_break_value_set
#define RBREAK_VALUE_TT_MASK

Function Details

mrb_noreturn mrb_sys_fail(mrb_state * mrb, const char * mesg)

mrb_value mrb_exc_new_str(mrb_state * mrb, struct RClass* c, mrb_value str)

mrb_noreturn mrb_no_method_error(mrb_state * mrb, mrb_sym id, mrb_value args, const char * fmt, ... )

void mrb_clear_error(mrb_state * mrb)

clear error status in the mrb_state structure

mrb_bool mrb_check_error(mrb_state * mrb)

returns TRUE if error in the previous call; internally calls mrb_clear_error()

mrb_value mrb_protect_error(mrb_state * mrb, mrb_protect_error_func * body, void * userdata, mrb_bool * error)

mrb_value mrb_protect(mrb_state * mrb, mrb_func_t body, mrb_value data, mrb_bool * state)

Protect (takes mrb_value for body argument)

Implemented in the mruby-error mrbgem

mrb_value mrb_ensure(mrb_state * mrb, mrb_func_t body, mrb_value b_data, mrb_func_t ensure, mrb_value e_data)

Ensure

Implemented in the mruby-error mrbgem

mrb_value mrb_rescue(mrb_state * mrb, mrb_func_t body, mrb_value b_data, mrb_func_t rescue, mrb_value r_data)

Rescue

Implemented in the mruby-error mrbgem

mrb_value mrb_rescue_exceptions(mrb_state * mrb, mrb_func_t body, mrb_value b_data, mrb_func_t rescue, mrb_value r_data, mrb_int len, struct RClass * , classes )

Rescue exception

Implemented in the mruby-error mrbgem