<!-- ##### SECTION Title ##### -->
matecomponent-exception

<!-- ##### SECTION Short_Description ##### -->
maps CORBA exceptions to user readable text, + helper macros

<!-- ##### SECTION Long_Description ##### -->
<para>
This module contains some useful helper functions
that can be used to set various exceptions inside your
CORBA methods. It also contains code to map between
complex CORBA_Environment exceptions and helpful
strings suitable for display to the user.
</para>

<para>
Typically to test for exceptions the MATECOMPONENT_EX macro
is used thus:
  <example>
     <title>MateComponent exception trapping and reporting</title>
     <programlisting>
int
do_something (CORBA_Environment *ev)
{
	...

	retval = Foo_Baa_method (object, ev);

	if (MATECOMPONENT_EX (ev)) {
		if (MATECOMPONENT_USER_EX (ev, ex_CosNaming_NamingContext_NotFound)) {
		        g_warning ("Not found");
		} else {
		        char *str;

			g_warning ("Exception '%s' occured",
				(str = matecomponent_exception_get_text (ev)));
			g_free (str);
		}
		return -1;
	}
	...
}
     </programlisting>
  </example>

</para>

<!-- ##### SECTION See_Also ##### -->
<para>

</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### SECTION Image ##### -->


<!-- ##### MACRO matecomponent_exception_set ##### -->
<para>
This macro sets the stateless user exception with @repo_id on
@opt_ev or warns if @opt_ev == NULL
</para>

@opt_ev: an optional corba exception environment.
@repo_id: repoid of the exception to set.


<!-- ##### MACRO matecomponent_return_if_fail ##### -->
<para>
this macro is used for matecomponent preconditons on argument types,
usualy inside skels if @expr is FALSE a warning is printed and
@opt_ev is set to ex_MateComponent_BadArg.
</para>

@expr: an expression that should be true
@opt_ev: an optional corba exception environment.


<!-- ##### MACRO matecomponent_return_val_if_fail ##### -->
<para>
this macro is used for matecomponent preconditons on argument types,
usualy inside skels if @expr is FALSE a warning is printed and
@opt_ev is set to ex_MateComponent_BadArg.
</para>

@expr: an expression that should be true
@val: a value to return on failure.
@opt_ev: an optional corba exception environment.


<!-- ##### MACRO MATECOMPONENT_EX ##### -->
<para>
This macro returns TRUE if @ev flags an exception.
</para>

@ev: the exception environment


<!-- ##### MACRO MATECOMPONENT_USER_EX ##### -->
<para>
This macro returns TRUE if @ev contains a user exception
of type @id.
</para>

@ev: the exception environment
@id: the repo_id of the exception


<!-- ##### MACRO MATECOMPONENT_EX_REPOID ##### -->
<para>
Returns the repoid string of exception @ev.
</para>

@ev: a CORBA exception


<!-- ##### MACRO MATECOMPONENT_RET_EX ##### -->
<para>
returns if there is an exception flagged in @ev.
</para>

@ev: the exception environment


<!-- ##### MACRO MATECOMPONENT_RET_VAL_EX ##### -->
<para>
returns @v if there is an exception flagged in @ev
</para>

@ev: the exception environment
@v: the value to return


<!-- ##### USER_FUNCTION MateComponentExceptionFn ##### -->
<para>
The prototype for user registerable exception decoders.
</para>

@ev: the exception environment
@user_data: user data to be passed to the function
@Returns: a g_malloc'd copy of a translated user readable error string.


<!-- ##### FUNCTION matecomponent_exception_get_text ##### -->
<para>
</para>

@ev: 
@Returns: 


<!-- ##### FUNCTION matecomponent_exception_repoid_to_text ##### -->
<para>

</para>

@repo_id: 
@Returns: 


<!-- ##### FUNCTION matecomponent_exception_add_handler_str ##### -->
<para>
</para>

@repo_id: 
@str: 


<!-- ##### FUNCTION matecomponent_exception_add_handler_fn ##### -->
<para>
</para>

@repo_id: 
@fn: 
@user_data: 
@destroy_fn: 


<!-- ##### FUNCTION matecomponent_exception_general_error_set ##### -->
<para>

</para>

@ev: 
@opt_deriv: 
@format: 
@Varargs: 


<!-- ##### FUNCTION matecomponent_exception_general_error_get ##### -->
<para>

</para>

@ev: 
@Returns: 


