Logging exceptions

This is an old revision of Logging exceptions, edited by Chronos at . The current revision is 69515.

New page: =Handling exceptions= ==Application.OnException== <delphi>procedure TMainForm.CustomExceptionHandler(Sender: TObject; E: Exception); begin ShowMessage(E.Message); end; procedure TMai...

Handling exceptions

Application.OnException

<delphi>procedure TMainForm.CustomExceptionHandler(Sender: TObject; E: Exception); begin

 ShowMessage(E.Message);

end;

procedure TMainForm.FormCreate(Sender: TObject); begin

 Application.OnException := @CustomExceptionHandler;

end;

procedure TMainForm.ButtonClick(Sender: TObject); begin

 raise Exception.Create('Test');

end;</delphi>

Getting stacktrace

Compiler parameters