gatelib  2.1
Exception Macro usage.

Example of use of G_EXC_RAISE

G_EXC_DEFINE_MSG ( MethodFailException , g::Exception , "Method failure reason" )

void MyCls::method ( const char* a )
{
G_EXC_SET_CONTEXT("void MyCls::method ( const char* a )");//You MUST specify the context inside the function.

G_EXC_RAISE ( MethodFailException );
}

Example of use of G_EXC_RAISE_MSG

G_EXC_DEFINE ( MethodFailException , g::Exception )

void MyCls::method ( const char* a )
{
G_EXC_SET_CONTEXT("void MyCls::method ( const char* a )");//You MUST specify the context inside the function.

G_EXC_RAISE_MSG ( MethodFailException , "Method failure reason" );
}

See also
g_exception_macros