Skip to content

ExceptionType ​

The function ExceptionType returns an exception object that is used in the ExceptionToString function and RaiseException function.

It is simply the type of exception error that has occurred.

Please refer to ExceptionToString and RaiseException for more detailed information about these functions.

Declaration: function ExceptionType: TIFException;

An example showing its use within LogInfo. In this case it is divide by Zero.

pascal
procedure OnMapEvent(var Value:Variant);
var
  Int1, Int2, Int3 : integer;
begin
 //Try to divide an integer by zero - to raise an exception
 try
    Int1 := 10;
    Int2 := 0;
    Int3 := Int1 / Int2;
 //These lines will execute if no error
    LogInfo('Fabulous!');
    LogInfo('There was no problem encountered!');
 except
    LogInfo('Exception occurred: ' + ExceptionToString(ExceptionType, ExceptionParam));
    LogInfo('');
    Int3 := 100;
    LogInfo('The variable has been set to '+IntToStr(Int3));
 end;
  LogInfo('');
  LogInfo('The Action has completed.');
end;