Skip to content

Instantly share code, notes, and snippets.

@jpluimers
Created March 21, 2014 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpluimers/9683205 to your computer and use it in GitHub Desktop.
Save jpluimers/9683205 to your computer and use it in GitHub Desktop.
When handling `Application.OnException` add the `ExceptAddr` to in Delphi the menu `Search` -> `Go to address` has a chance of working, and the `ClassName` so you know what happened.
procedure TMainForm.Application_OnException(Sender: TObject; E: Exception);
var
lMessage: String;
begin
lMessage := E.Message;
{$IFDEF DEBUG}
lMessage := Format('%s at $%p: %s', [E.ClassName, ExceptAddr, lMessage]);
{$ENDIF DEBUG}
BringToFront();
MessageDlg(lMessage, mtError, [mbOK], 0);
end;
// Application.OnException := Application_OnException;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment