ShowLastExceptionData procedure

Top  Previous  Next

EurekaLog includes a procedure called ShowLastExceptionData, that enables you to display the data of the last raised exception.

 

This procedure is usefully if used in a "re-raised block" (a raise command in an except/end block) without lost the original exception line.

 

Syntax of this procedure is as follows:

 

 

procedure ShowLastExceptionData;

 

 

Example (with raise command):

 

 

uses ExceptionLog; // The required unit...

 

begin

   ...

   try

     raise Exception.Create('Original exception!');

   except

     raise// <-- WARNING - Will be displayed this line as exception line,

            //               losing the original exception line!!!

   end;

   ...

end;

 

 

 

Example (with ShowLastExceptionData procedure):

 

 

uses ExceptionLog; // The required unit...

 

begin

   ...

   try

     raise Exception.Create('Original exception!'); // <-- Will be displayed this line as exception line!

   except

     ShowLastExceptionData;

     Abort;

   end;

   ...

end;