Vcl.AppEvnts.TApplicationEvents.OnException

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnException;

C++

__property OnException;

Properties

Type Visibility Source Unit Parent
event published
Vcl.AppEvnts.pas
Vcl.AppEvnts.hpp
Vcl.AppEvnts TApplicationEvents

Description

Occurs when an unhandled exception occurs in the application.

Vcl.AppEvnts.TApplicationEvents.OnException inherits from Vcl.AppEvnts.TCustomApplicationEvents.OnException. All content below this line refers to Vcl.AppEvnts.TCustomApplicationEvents.OnException.

Occurs when an unhandled exception occurs in the application.

Use OnException to change the default behavior that occurs when an exception is not handled by application code. The OnException event handler is called automatically in the application's 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.

If an exception passes through the try blocks in the application code, the application automatically calls the HandleException method. Unless the exception object is EAbort, HandleException calls the OnException handler, if one exists. Otherwise, it calls ShowException to display a message box indicating an error occurred.

Note: Call the CancelDispatch method from an OnException event handler to prevent the application from forwarding the event to any other application events objects.

See Also

Code Examples