mruby/c VM Source Code release 3.4
Loading...
Searching...
No Matches
error.c File Reference

exception classes More...

#include "mrubyc.h"
#include "_autogen_class_exception.h"
Include dependency graph for error.c:

Go to the source code of this file.

Functions

static mrbc_exceptionsub_exception_new (struct VM *vm, struct RClass *exc_cls)
mrbc_value mrbc_exception_new (struct VM *vm, struct RClass *exc_cls, const void *message, int len)
mrbc_value mrbc_exception_new_alloc (struct VM *vm, struct RClass *exc_cls, const void *message, int len)
void mrbc_exception_delete (mrbc_value *value)
void mrbc_raise (struct VM *vm, struct RClass *exc_cls, const char *msg)
void mrbc_raisef (struct VM *vm, struct RClass *exc_cls, const char *fstr,...)
void mrbc_clear_exception (struct VM *vm)
void mrbc_print_exception (const mrbc_value *v)
void mrbc_print_vm_exception (const struct VM *vm)

Detailed Description

exception classes

Copyright (C) 2015- Kyushu Institute of Technology.
Copyright (C) 2015- Shimane IT Open-Innovation Center.

This file is distributed under BSD 3-Clause License.

Definition in file error.c.

Function Documentation

◆ mrbc_clear_exception()

void mrbc_clear_exception ( struct VM * vm)

clear raised exception

Parameters
vmpointer to VM.

Definition at line 206 of file error.c.

Here is the call graph for this function:

◆ mrbc_exception_delete()

void mrbc_exception_delete ( mrbc_value * value)

destructor

Parameters
valuetarget.

Definition at line 133 of file error.c.

Here is the call graph for this function:

◆ mrbc_exception_new()

mrbc_value mrbc_exception_new ( struct VM * vm,
struct RClass * exc_cls,
const void * message,
int len )

constructor

Parameters
vmpointer to VM.
exc_clspointer to Exception class.
messagemessage.
lenmessage length or zero.
Returns
exception object.

Definition at line 65 of file error.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mrbc_exception_new_alloc()

mrbc_value mrbc_exception_new_alloc ( struct VM * vm,
struct RClass * exc_cls,
const void * message,
int len )

constructor with allocated message buffer.

Parameters
vmpointer to VM.
exc_clspointer to Exception class.
messagemessage buffer.
lenmessage length.
Returns
exception object.

Definition at line 116 of file error.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mrbc_print_exception()

void mrbc_print_exception ( const mrbc_value * v)

display exception

Parameters
vpointer to Exception object.

Definition at line 219 of file error.c.

Here is the call graph for this function:

◆ mrbc_print_vm_exception()

void mrbc_print_vm_exception ( const struct VM * vm)

display exception in vm.

Parameters
vmpointer to VM

Definition at line 236 of file error.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mrbc_raise()

void mrbc_raise ( struct VM * vm,
struct RClass * exc_cls,
const char * msg )

raise exception

Parameters
vmpointer to VM.
exc_clspointer to Exception class or NULL.
msgmessage or NULL.
Note
(usage) mrbc_raise(vm, MRBC_CLASS(TypeError), "message here.");

Definition at line 150 of file error.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mrbc_raisef()

void mrbc_raisef ( struct VM * vm,
struct RClass * exc_cls,
const char * fstr,
... )

raise exception like printf

Parameters
vmpointer to VM.
exc_clspointer to Exception class.
fstrformat string.

Definition at line 173 of file error.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sub_exception_new()

mrbc_exception * sub_exception_new ( struct VM * vm,
struct RClass * exc_cls )
static

Definition at line 32 of file error.c.

Here is the caller graph for this function: