Examples

Top  Previous  Next

In case an error occurs when trying to save or send an error report, EurekaLog allows the developer to write custom behavior, and ask for a retry. In this simple example, when error occurs, the application asks the user if he wants to retry the operation.

 

 

C# example:

private void eurekaLog1_ExceptionErrorNotify(Exception Error, EurekaLogSystem.EurekaLogOptions Options, EurekaLogSystem.EurekaActionType Action, ref bool Retry)
{
  switch (Action)
  {
      case EurekaLogSystem.EurekaActionType.atSavingLogFile:
          Retry = MessageBox.Show("Failed saving the log file. Retry?", "EurekaLog",
              MessageBoxButtons.RetryCancel) == DialogResult.Retry;
          break;
      case EurekaLogSystem.EurekaActionType.atSendingEmail:
          Retry = MessageBox.Show("Failed sending an e-mail. Retry?", "EurekaLog",
              MessageBoxButtons.RetryCancel) == DialogResult.Retry;
          break;
      case EurekaLogSystem.EurekaActionType.atSendingWebMessage:
          Retry = MessageBox.Show("Failed sending a web message. Retry?", "EurekaLog",
              MessageBoxButtons.RetryCancel) == DialogResult.Retry;
          break;
  }
}

 

 

Visual Basic example:

Private Sub EurekaLog1_ExceptionErrorNotify(ByVal [Error] As System.Exception, ByVal Options As EurekaLogSystem.EurekaLogOptions, ByVal Action As EurekaLogSystem.EurekaActionType, ByRef Retry As System.Boolean) Handles EurekaLog1.ExceptionErrorNotify
  Select Case Action
      Case EurekaLogSystem.EurekaActionType.atSavingLogFile
           Retry = MessageBox.Show("Failed saving the log file. Retry?", "EurekaLog", MessageBoxButtons.RetryCancel) = DialogResult.Retry
      Case EurekaLogSystem.EurekaActionType.atSendingEmail
           Retry = MessageBox.Show("Failed sending an e-mail. Retry?", "EurekaLog", MessageBoxButtons.RetryCancel) = DialogResult.Retry
      Case EurekaLogSystem.EurekaActionType.atSendingWebMessage
           Retry = MessageBox.Show("Failed sending a web message. Retry?", "EurekaLog", MessageBoxButtons.RetryCancel) = DialogResult.Retry
  End Select
End Sub