Root > Compatibility > 5.x -> 6.x > EurekaLog 6 Documentation > Events > ExceptionNotify event > Examples

Examples

Previous pageReturn to chapter overviewNext page   

Caution: this is old EurekaLog 6 documentation. This is not the latest version.

 

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;




Send feedback... Build date: 2018-11-27
Last edited: 2018-06-14
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/old_exceptionnotify_examples.php