1
0
mirror of synced 2024-11-08 14:19:16 +00:00
x2log/X2Log.Exception.madExceptHandler.pas

40 lines
880 B
ObjectPascal

unit X2Log.Exception.madExceptHandler;
interface
uses
System.SysUtils,
X2Log.Intf,
X2Log.Exception.Default;
type
TX2LogmadExceptExceptionStrategy = class(TX2LogDefaultExceptionStrategy)
public
{ IX2LogExceptionStrategy }
procedure Execute(AException: Exception; out AMessage: string; AAddDetails: TX2LogExceptionDetailsProc); override;
end;
implementation
uses
madExcept,
X2Log.Details.Default;
{ TX2LogmadExceptExceptionStrategy }
procedure TX2LogmadExceptExceptionStrategy.Execute(AException: Exception; out AMessage: string; AAddDetails: TX2LogExceptionDetailsProc);
var
bugReport: string;
begin
inherited Execute(AException, AMessage, AAddDetails);
bugReport := madExcept.CreateBugReport(etNormal, AException);
if Length(bugReport) > 0 then
AAddDetails('StackTrace', bugReport);
end;
end.