Codemesh Runtime v3 C++ API Reference  3.9.205
Public Member Functions | List of all members
xmog_error_handler Class Reference

The type responsible for error handling. More...

#include <xmog_error_handler.h>

Public Member Functions

 xmog_error_handler (xmog_options *opts=NULL)
 Creates an error handler instance based on a framework configuration instance. More...
 
 xmog_error_handler (const xmog_error_handler &eh)
 Creates an error handler instance based on an existing error handler instance. More...
 
 ~xmog_error_handler ()
 Cleans up behind the instance.
 
xmog_exception_policy set_policy (xmog_exception_policy pol)
 Sets the errorhandling policy. More...
 
xmog_exception_policy get_policy ()
 Returns the errorhandling policy.
 
int handleJavaException (int error_code, xmog_localenv *env=NULL, bool ignore=false)
 Handles a Java exception in the local environment. More...
 
int handleFrameworkException (int error_code, const char *msg=NULL, xmog_localenv *env=NULL, bool ignore=false)
 Handles an generic framework exception. More...
 

Detailed Description

The type responsible for error handling.

This type is initialized from the runtime options but it also provides a copy constructor because each thread will have to have its own error handler instance. This is necessary because a user must be able to set the errorhandling strategy on a per-thread basis.

Constructor & Destructor Documentation

◆ xmog_error_handler() [1/2]

xmog_error_handler::xmog_error_handler ( xmog_options opts = NULL)

Creates an error handler instance based on a framework configuration instance.

Parameters
optsthe framework initialization instance.

◆ xmog_error_handler() [2/2]

xmog_error_handler::xmog_error_handler ( const xmog_error_handler eh)

Creates an error handler instance based on an existing error handler instance.

Parameters
ehthe prototype for the new error handler.

Member Function Documentation

◆ handleFrameworkException()

int xmog_error_handler::handleFrameworkException ( int  error_code,
const char *  msg = NULL,
xmog_localenv env = NULL,
bool  ignore = false 
)

Handles an generic framework exception.

Parameters
error_codethe exception code.
msgthe optional error message.
envthe local environment in which the exception was thrown.
ignoretrue if the exception should be ignored, false otherwise. The default value is false.
Returns
0 if no exception was thrown, non=zero otherwise.

◆ handleJavaException()

int xmog_error_handler::handleJavaException ( int  error_code,
xmog_localenv env = NULL,
bool  ignore = false 
)

Handles a Java exception in the local environment.

This method can be called safely even if no exception was thrown; in this case it will simply return with a value of 0.

Parameters
error_codethe exception code that is used in cases where no exception is thrown.
envthe local environment in which the exception was thrown.
ignoretrue if the exception should be ignored, false otherwise. The default value is false.
Returns
0 if no exception was thrown, non=zero otherwise.

◆ set_policy()

xmog_exception_policy xmog_error_handler::set_policy ( xmog_exception_policy  pol)

Sets the errorhandling policy.

Returns
the previous value of the exception policy.

The documentation for this class was generated from the following file:

Copyright (c) 1999-2020 by Codemesh, Inc., ALL RIGHTS RESERVED.