Root > How to... > ...get exception info?

...get exception info?

Previous pageReturn to chapter overviewNext page   

Exception info is represented by TEurekaExceptionInfo class from EException unit.

 

 

Option 1

Assuming you are inside EurekaLog's event handler - this information is passed as argument:

 

uses
  EEvents;
 
procedure MyExceptionNotifyHandler(const ACustom: Pointer; 

  AExceptionInfo: TEurekaExceptionInfo; // <- here

  var AHandle: Boolean; 

  var ACallNextHandler: Boolean);
begin
  // use AExceptionInfo

  // ...
end;
 
initialization
  RegisterEventExceptionNotify(nil, MyExceptionNotifyHandler);
end.

 

 

Option 2

Assuming you have access to RTL's exception object:

 

uses
  EExceptionManager, // for ExceptionManager
  EException;        // for TEurekaExceptionInfo 
 
var
  EI: TEurekaExceptionInfo;
// ...
  except
    on E: Exception do
    begin
      EI := ExceptionManager.Info(E);

      // ...
    end;
  end;

 

Note: due to bugs in some older IDEs, you may need to write like this:

      EI := ExceptionManager.Info(Pointer(E));

 

 

Option 3

Assuming you want exception info for last (e.g. most recent) exception in current thread:

 

uses
  EExceptionManager, // for ExceptionManager
  EException;        // for TEurekaExceptionInfo 

 
var
  EI: TEurekaExceptionInfo;
begin
  EI := ExceptionManager.LastThreadException;
  // ...
end;

 

 

See also:




Send feedback... Build date: 2018-11-26
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/how_to_get_exception_info.php