Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // See also: http://pastebin.com/46QkwZNi - "how to convert call stack to text"
- // See also: http://pastebin.com/rdNbEwPH - "how to get call stack on demand"
- // See also: http://pastebin.com/ACtr0r6S - "how to silently log exception"
- // See also: http://pastebin.com/sBn3PA1r - "how to create hang/deadlock report on demand"
- // Option 1:
- except
- on E: Exception do
- Memo1.Lines.Text := E.StackTrace;
- end;
- // Option 2:
- uses
- EExceptionManager,
- EException;
- var
- EI: TEurekaExceptionInfo;
- begin
- EI := ExceptionManager.LastThreadException;
- if Assigned(EI) then // EI would be nil, if EurekaLog is disabled or event handlers instruct EurekaLog to skip this exception
- Memo1.Lines.Text := EI.CallStack.ToString;
- end;
- // Option 3:
- uses
- EExceptionManager,
- EException;
- var
- EI: TEurekaExceptionInfo;
- // ...
- except
- on E: Exception do
- begin
- EI := ExceptionManager.Info(E);
- if Assigned(EI) then // EI would be nil, if EurekaLog is disabled or event handlers instruct EurekaLog to skip this exception
- Memo1.Lines.Assign(EI.CallStack);
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement