End

procedure ECustomException.

RaisingException(P: PExceptionRecord); begi n

// log exception information (to file would be smarter!) FormExceptions.Log( 'Exception Addr: ' + IntToHex (

Integer(P.ExceptionAddress), 8)); FormExceptions.Log( 'Exception Mess: ' + Message);

// modify the message

/// standard processing inherited; end;

What this method implementation does is to log some information about the exception, modify the exception message and than invoke the standard processing of the base classes (needed for the nested exception mechanism to work). The method is invoked after the exception object has been created but before the exception is raised. This can be noticed because the output produced by the Log calls is generated before the exception is caught by the debugger! Similarly, if you put a breakpoint in the RaisingException method, the debugger will stop there before catching the exception.

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment