Project Lucy has retired. For details please refer to its Attic page.
Clownfish::Err – C API Documentation
Apache Lucy™

Clownfish::Err

parcel Clownfish
class variable CFISH_ERR
struct symbol cfish_Err
class nickname cfish_Err
header file Clownfish/Err.h

Name

Clownfish::Err – Exception.

Description

Clownfish::Err is the base class for exceptions in the Clownfish object hierarchy.

The Err module also provides access to a per-thread Err shared variable via set_error() and get_error(). It may be used to store an Err object temporarily, so that calling code may choose how to handle a particular error condition.

Functions

set_error
void
cfish_Err_set_error(
    cfish_Err *error // decremented
);

Set the global error object, a per-thread Err shared variable.

get_error
cfish_Err*
cfish_Err_get_error(void);

Retrieve the global error object, a per-thread Err shared variable.

trap
cfish_Err* // incremented
cfish_Err_trap(
    CFISH_Err_Attempt_t routine,
    void *context
);

Run routine within the host’s exception handling environment, catching and returning any errors that occur.

If an unrecognized host exception is trapped, it will be wrapped in an Err so that it can be handled by Clownfish code.

Returns: an Err, or NULL if no exception occurs.

Methods

To_String
cfish_String* // incremented
cfish_Err_To_String(
    cfish_Err *self
);

Return a copy of the error message.

Cat_Mess
void
cfish_Err_Cat_Mess(
    cfish_Err *self,
    cfish_String *mess
);

Concatenate the supplied argument onto the error message.

Get_Mess
cfish_String*
cfish_Err_Get_Mess(
    cfish_Err *self
);

Return the error message.

Inheritance

Clownfish::Err is a Clownfish::Obj.