node-addon-layer
C API For writing Node modules
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
Error methods

Functions

shim_val_tshim_error_new (shim_ctx_t *ctx, const char *msg,...)
 
shim_val_tshim_error_type_new (shim_ctx_t *ctx, const char *msg,...)
 
shim_val_tshim_error_range_new (shim_ctx_t *ctx, const char *msg,...)
 
shim_bool_t shim_exception_pending (shim_ctx_t *ctx)
 
void shim_exception_clear (shim_ctx_t *ctx)
 
void shim_exception_set (shim_ctx_t *ctx, shim_val_t *val)
 
shim_bool_t shim_exception_get (shim_ctx_t *ctx, shim_val_t *rval)
 
void shim_throw_error (shim_ctx_t *ctx, const char *msg,...)
 
void shim_throw_type_error (shim_ctx_t *ctx, const char *msg,...)
 
void shim_throw_range_error (shim_ctx_t *ctx, const char *msg,...)
 

Detailed Description

Methods for errors

Function Documentation

shim_val_t* shim_error_new ( shim_ctx_t ctx,
const char *  msg,
  ... 
)

Create a new error

Parameters
ctxCurrently executing context
msgThe message to be used for error
...Arguments for formatting
Returns
The wrapped Error
shim_val_t* shim_error_range_new ( shim_ctx_t ctx,
const char *  msg,
  ... 
)

create a new RangeError

Parameters
ctxCurrently executing context
msgThe message to be used for error
...Arguments for formatting
Returns
The wrapped RangeError
shim_val_t* shim_error_type_new ( shim_ctx_t ctx,
const char *  msg,
  ... 
)

Create a new TypeError

Parameters
ctxCurrently executing context
msgThe message to be used for error
...Arguments for formatting
Returns
The wrapped TypeError
void shim_exception_clear ( shim_ctx_t ctx)

Clear any pending exception

Parameters
ctxCurrently executing context
shim_bool_t shim_exception_get ( shim_ctx_t ctx,
shim_val_t rval 
)

Get the pending exception

Parameters
ctxCurrently executing context
rvalThe currently pending exception
Returns
TRUE if there was an exception, otherwise FALSE
shim_bool_t shim_exception_pending ( shim_ctx_t ctx)

Check if there is a pending exception

Parameters
ctxCurrently executing context
Returns
TRUE if an exception is pending, otherwise FALSE
void shim_exception_set ( shim_ctx_t ctx,
shim_val_t val 
)

Set the pending exception

Parameters
ctxCurrently executing context
valThe error to use as the pending exception
void shim_throw_error ( shim_ctx_t ctx,
const char *  msg,
  ... 
)

Throw an error

Parameters
ctxCurrently executing context
msgThe message to set as the pending exception
...Arguments for formatting
void shim_throw_range_error ( shim_ctx_t ctx,
const char *  msg,
  ... 
)

Throw a RangeError

Parameters
ctxCurrently executing context
msgThe message to set as the pending exception
...Arguments for formatting
void shim_throw_type_error ( shim_ctx_t ctx,
const char *  msg,
  ... 
)

Throw a TypeError

Parameters
ctxCurrently executing context
msgThe message to set as the pending exception
...Arguments for formatting