Delphi What Is The OnException Event in DelphiVCL.Application?

FireWind

Свой
Регистрация
2 Дек 2005
Сообщения
1,957
Реакции
1,199
Credits
4,009
What Is The OnException Event in DelphiVCL.Application?
By Muhammad Azizul Hakim December 27, 2021

The OnException or DelphiVCL.Application.OnException event occurs when an unhandled exception occurs in the application. This is a fundamental error event to understand when you Для просмотра ссылки Войди или Зарегистрируйся.

How is the DelphiVCL.Application.OnException event used?​

Use OnException to change the default behavior that occurs when an exception (a critical error) is not handled by regular application code. The OnException event handler is called automatically in the HandleException method.

OnException only handles exceptions that occur during message processing. Exceptions that occur before or after the execution of the application’s Run method do not generate OnException events.

Let’s take a look at all of DelphiVCL.Application.OnException properties and methods:
Python:
import DelphiVCL
 
dir(DelphiVCL.Application.OnException)
See the responses in our Windows command prompt:
1640591094386.png
You can also read short information about the DelphiVCL.Application.OnException using the print() command:
Python:
print(DelphiVCL.Application.OnException)
print(DelphiVCL.Application.OnException.__doc__)
See the responses in our Windows command prompt:
1640591124808.png