mruby 3.3.0
mruby is the lightweight implementation of the Ruby language
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
error.h File Reference

More...

#include "common.h"
Include dependency graph for error.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  RException
 mruby error handling. More...
 
struct  RBreak
 

Macros

#define MRB_EXC_EXIT   65536
 
#define MRB_EXC_EXIT_P(e)   ((e)->flags & MRB_EXC_EXIT)
 
#define MRB_EXC_EXIT_STATUS(mrb, e)   ((int)mrb_as_int((mrb),mrb_obj_iv_get((mrb),(e),MRB_SYM(status))))
 
#define MRB_EXC_CHECK_EXIT(mrb, e)   do {if (MRB_EXC_EXIT_P(e)) exit(MRB_EXC_EXIT_STATUS((mrb),(e)));} while (0)
 
#define mrb_exc_ptr(v)   ((struct RException*)mrb_ptr(v))
 
#define mrb_exc_new_lit(mrb, c, lit)   mrb_exc_new_str(mrb, c, mrb_str_new_lit(mrb, lit))
 
#define MRB_USE_RBREAK_VALUE_UNION   1
 
#define RBREAK_VALUE_TT_MASK   ((1 << 8) - 1)
 

Typedefs

typedef mrb_value mrb_protect_error_func(mrb_state *mrb, void *userdata)
 Protect.
 

Functions

void mrb_sys_fail (mrb_state *mrb, const char *mesg)
 
mrb_value mrb_exc_new_str (mrb_state *mrb, struct RClass *c, mrb_value str)
 
void mrb_no_method_error (mrb_state *mrb, mrb_sym id, mrb_value args, const char *fmt,...)
 
static mrb_value mrb_break_value_get (struct RBreak *brk)
 
static void mrb_break_value_set (struct RBreak *brk, mrb_value val)
 
void mrb_clear_error (mrb_state *mrb)
 Error check.
 
mrb_bool mrb_check_error (mrb_state *mrb)
 
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)
 
mrb_value mrb_ensure (mrb_state *mrb, mrb_func_t body, mrb_value b_data, mrb_func_t ensure, mrb_value e_data)
 Ensure.
 
mrb_value mrb_rescue (mrb_state *mrb, mrb_func_t body, mrb_value b_data, mrb_func_t rescue, mrb_value r_data)
 Rescue.
 
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.
 

Detailed Description

See Copyright Notice in mruby.h

Typedef Documentation

◆ mrb_protect_error_func

typedef mrb_value mrb_protect_error_func(mrb_state *mrb, void *userdata)

Protect.

Function Documentation

◆ mrb_clear_error()

void mrb_clear_error ( mrb_state mrb)

Error check.

◆ mrb_ensure()

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_protect()

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_rescue()

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_rescue_exceptions()

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