Application.onError event

Hello,

I wrote procedure which is responsible for getting all exceptions in the web application. The code is:

procedure TfrmLoginForm.WebFormCreate(Sender: TObject);
begin
  Application.ThemeColor := $8F814D;
  Application.OnError := AppException;
end;

Implementation AppException procedure is:

procedure TfrmLoginForm.AppException(Sender: TObject; AError: TAppplicationError; var Handled:Boolean);
begin
  Handled:=True;
  MessageDlg('Wystąpił błąd: '+AError.AMessage, mtError, [], nil);
end;

I set Handled:=True; and according to documentation:
"When the Handled parameter is set to true, the standard error is not longer performed."
but I still getting red panel with standard output error exception.

Why?

Regards

The issue was solved ... standard output error is in only debug mode ... when I'm in release mode all  is ok.

Regards

Thanks for informing. It is by design that these error messages only appear in debug mode.

procedure TfrmLoginForm.AppException(Sender: TObject; AError: TAppplicationError; var Handled:Boolean);

Hi,

TAppplicationError shouldn't it be TApplicationError ?

That is indeed a typo.
We corrected it.