Examples

Top  Previous  Next

Some examples:

 

// Check unit name...

procedure MyNotify(ExcRecord: TEurekaExceptionRecord; var Handled: Boolean);

begin

   // Check for SourceCode information...

   if (ExcRecord.CallStack[0]^.DebugDetail = ddSourceCode) and 

     (ExcRecord.CallStack[0]^.UnitName = 'System.pas'then Handled := False;

end;

 

 

// Show exception dialog?

procedure MyNotify(ExcRecord: TEurekaExceptionRecord; var Handled: Boolean);

begin

   with ExcRecord.CurrentModuleOptions do

   begin

     if (MessageBox(0'Do you want to show error details?''Question',

                    MB_YESNO or MB_ICONQUESTION or MB_TASKMODAL) = ID_YES) then

       ExceptionDialogType := edtEurekaLog // Replace this with the option you wish to use for the dialog display

     else

       ExceptionDialogType := edtNone;

   end;

end;

 

 

// Don't save the Log File...

procedure MyNotify(ExcRecord: TEurekaExceptionRecord; var Handled: Boolean);

begin

   ExcRecord.CurrentModuleOptions.SaveLogFile := False;

end;

 

 

// Don't handle this exception with EurekaLog but with standard Borland Exception Manager...

procedure MyNotify(ExcRecord: TEurekaExceptionRecord; var Handled: Boolean);

begin

   Handled := False;

end;

 

 

// Check exception type...

procedure MyNotify(ExcRecord: TEurekaExceptionRecord; var Handled: Boolean);

var Error: Exception;

begin

  if ExcRecord.ExceptionObject is Exception then

     begin

       Error := Exception(ExcRecord.ExceptionObject); // Obtain exception type...

       MessageBox(0,PChar(Format('Error: %s',[Error.Message])),'Error',

                  MB_OK or MB_ICONSTOP or MB_TASKMODAL);

       ExcRecord.CurrentModuleOptions.ExceptionDialogType := edtNone; // Don't show exception dialog.

     end;

end;