Created
March 21, 2014 10:15
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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