Error handlers

Each class that wants to use error handling must inherit from CErrorHandler.

 

In it's constructor set the class name, using: CErrorHandler::SetName.

 

We offer a few macros for each kind of scenario: (the macros are define at file ErrorHandlerMacros.h)

 

 

Examples:

 

ERROR_HANDLER

 

void MyClass::RegularHandler()

{

try

{

//Do some code

}

ERROR_HANDLER("RegularHandler")

}

 

ERROR_HANDLER_RETURN

 

BOOL MyClass::ReturnHandler()

{

try

{

//Do some code

return TRUE;

}

ERROR_HANDLER_RETURN("ReturnHandler",FALSE)

}

 

ERROR_HANDLER_STATIC

 

method is declared static

void MyClass::StaticHandler()

{

try

{

//Do some code

}

ERROR_HANDLER_STATIC("MyClass","StaticHandler")

}

 

ERROR_HANDLER_STATIC_RETURN

 

method is declared static

BOOL MyClass::StaticReturnHandler()

{

try

{

//Do some code

return TRUE;

}

ERROR_HANDLER_RETURN("MyClass","StaticReturnHandler",FALSE)

}