bonobo-exception

bonobo-exception

Functions

Description

Functions

bonobo_exception_set()

#define             bonobo_exception_set(opt_ev,repo_id)

bonobo_return_if_fail()

#define             bonobo_return_if_fail(expr,opt_ev)

bonobo_return_val_if_fail()

#define             bonobo_return_val_if_fail(expr,val,opt_ev)

BONOBO_EX()

#define BONOBO_EX(ev)         ((ev) != NULL && (ev)->_major != CORBA_NO_EXCEPTION)

BONOBO_USER_EX()

#define             BONOBO_USER_EX(ev,id)

BONOBO_EX_REPOID()

#define BONOBO_EX_REPOID(ev)  (ev)->_id

BONOBO_RET_EX()

#define             BONOBO_RET_EX(ev)

BONOBO_RET_VAL_EX()

#define             BONOBO_RET_VAL_EX(ev,v)

BonoboExceptionFn ()

char *
(*BonoboExceptionFn) (CORBA_Environment *ev,
                      gpointer user_data);

bonobo_exception_get_text ()

char *
bonobo_exception_get_text (CORBA_Environment *ev);

Returns a user readable description of the exception. First checks ev against builtin Bonobo exceptions, then falls back to exception names added through bonobo_exception_add_handler_str or bonobo_exception_add_handler_fn.

Parameters

ev

the corba environment.

 

Returns

A g_malloc'd description, which the caller must free. NULL is never returned.


bonobo_exception_repoid_to_text ()

char *
bonobo_exception_repoid_to_text (const char *repo_id);

This maps builtin bonobo exceptions that the system knows about to user readable strings.

Parameters

repo_id

exception repository id

 

Returns

a user string or NULL for an unknown repo_id


bonobo_exception_add_handler_str ()

void
bonobo_exception_add_handler_str (const char *repo_id,
                                  const char *str);

This routine adds a simple string mapping for an exception with repository id repo_id , such that when we call bonobo_exception_get_text on an exception of id repo_id we get str back.

Parameters

repo_id

exception repository id

 

str

the user readable, translated exception text.

 

bonobo_exception_add_handler_fn ()

void
bonobo_exception_add_handler_fn (const char *repo_id,
                                 BonoboExceptionFn fn,
                                 gpointer user_data,
                                 GDestroyNotify destroy_fn);

This routine adds a method mapping for an exception with repository id repo_id , such that when we call bonobo_exception_get_text on an exception of id repo_id the fn is called and passed user_data . When the handler is removed the destroy_fn is called on its user_data .

Parameters

repo_id

exception repository id

 

fn

function to make exception human readable

 

user_data

the user data

 

destroy_fn

user data destroy function or NULL.

 

bonobo_exception_general_error_set ()

void
bonobo_exception_general_error_set (CORBA_Environment *ev,
                                    CORBA_TypeCode opt_deriv,
                                    const char *format,
                                    ...);

bonobo_exception_general_error_get ()

const char *
bonobo_exception_general_error_get (CORBA_Environment *ev);