Examples

Top  Previous  Next

Some examples:

 

uses ECore, ETypes; // The required units...

 

// OnExceptionNotify example...

procedure TForm1.EurekaLog1ExceptionNotify(

  EurekaExceptionRecord: TEurekaExceptionRecord; var Handled: Boolean);

begin

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

  EurekaExceptionRecord.CurrentModuleOptions.SaveLogFile := False;

end;

 

See the "ExceptionNotify-Examples" topic for further details.

 

 

 

uses ECore, ETypes; // The required units...

 

// OnHandledExceptionNotify example...

procedure TForm1.EurekaLog1HandledExceptionNotify(

  EurekaExceptionRecord: TEurekaExceptionRecord; var Handled: Boolean);

begin

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

  EurekaExceptionRecord.CurrentModuleOptions.SaveLogFile := False;

end;

 

See the "ExceptionNotify-Examples" topic for further details.

 

 

 

uses ECore, ETypes; // The required units...

 

// OnExceptionActionNotify example...

procedure TForm1.EurekaLog1ExceptionActionNotify(

  EurekaExceptionRecord: TEurekaExceptionRecord;

  EurekaAction: TEurekaActionType; var Execute: Boolean);

begin

   // Show exception dialog?

   if EurekaAction = atShowingExceptionInfo then

     begin

       Execute := MessageBox(0,'Do you want to show error details?''Question',

                    MB_YESNO or MB_ICONQUESTION or MB_TASKMODAL)<>ID_YES;

    end;

end;

 

See the "ExceptionActionNotify-Examples" topic for further details.

 

 

 

uses ECore, ETypes; // The required units...

 

// OnExceptionErrorNotify example...

procedure TForm1.EurekaLog1ErrorNotify(

  EurekaExceptionRecord: TEurekaExceptionRecord;

  EurekaAction: TEurekaActionType; var Retry: Boolean);

begin

  // An error occurred when sending the email...

  if EurekaAction = atSentEmail then

    begin

      // Try to send the email via SMTP client.

      EurekaExceptionRecord.CurrentModuleOptions.SMTPHost := 'localhost';

      Retry := True; // Force retry of this action.

    end;

end;

 

See the "ExceptionErrorNotify-Examples" topic for further details.

 

 

 

uses ECore, ETypes; // The required units...

 

// OnAttachedFilesRequest example...

procedure TForm1.EurekaLog1AttachedFilesRequest(

  EurekaExceptionRecord: TEurekaExceptionRecord;

 AttachedFiles: TStrings);

var

  Path: string;

begin

  // Attach a file chose by user...

   Path := InputBox('Request''Insert the path of the file to send''');

   AttachedFiles.Add(Path);

end;

 

See the "AttachedFilesRequest-Examples" topic for further details.

 

 

 

uses ECore, ETypes; // The required units...

 

// OnCustomDataRequest example...

procedure TForm1.EurekaLog1CustomDataRequest(

  EurekaExceptionRecord: TEurekaExceptionRecord;

  DataFields: TStrings);

begin

  // Add custom data to the Log text...

   DataFields.Add('Field=My custom data...';

end;

 

See the "CustomDataRequest-Examples" topic for further details.

 

 

 

uses ECore, ETypes; // The required units...

 

// OnCustomFieldsRequest example...

procedure TForm1.EurekaLog1CustomWebFieldsRequest(

  EurekaExceptionRecord: TEurekaExceptionRecord;

  WebFields: TStrings);

begin

  // Send the software identification ID to the Web server

   FieldsName.Add('Software_ID');   

   FieldsValue.Add('F0E0D0');

end;

 

See the "CustomFieldsRequest-Examples" topic for further details.

 

 

 

uses ECore, ETypes; // The required units...

 

// OnPasswordRequest example...

procedure TForm1.EurekaLog1PasswordRequest(

  EurekaExceptionRecord: TEurekaExceptionRecord;

  var Password: string);

begin

  // Require the password to the user...

  InputQuery('Request', 'Insert the BUG report password', Password);

end;

 

See the "PasswordRequest-Examples" topic for further details.

 

 

 

uses ECore, ETypes; // The required units...

 

// Close the dialog.

procedure TForm1.EurekaLog1CustomButtonClickNotify(

   EurekaExceptionRecord: TEurekaExceptionRecord; 

   var CloseDialog: Boolean);

begin

   CloseDialog := True;

end;

 

See the "CustomButtonClickNotify-Examples" topic for further details.