[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Forms' (#lcl)

# TApplication.ShowException

Shows the message for the specified exception and asks the user to abort or continue.

## Declaration

Source position: forms.pp line 1636

`public procedure TApplication.ShowException(`
`E: Exception`
`); override;`

## Arguments

`E` |  | The exception with the message to display in the method.

## Description

E is the Exception instance with the message displayed in the method. If the message contains an invalid UTF-8 codepoint, AnsiToUtf8 is called to get a valid UTF-8 value for the exception message.

ShowException creates a dialog to display the exception message. If the exception occurred before the application was fully initialized, the inherited ShowException method is called.

The value in the ExceptionDialog property determines the type of dialog displayed for the message, and the buttons available on the dialog. While the dialog is active, the OnIdle event handlers in the application are disabled. They are re-enabled when the dialog is closed. The modal result from the dialog determines whether the application is terminated by calling Halt, or allowed to continue.

Remark: | No actions are performed in the method when AppNoExceptionMessages has been included in the Flags for the application. The exception message is not displayed and control is returned to the calling routine.

## See also

TApplication.ExceptionDialog |  | Indicates the dialog type used for an exception in the application.
TApplication.Flags |  | Contains state flags for the application.
TApplicationFlags |  | Set type used to store values from the TApplicationFlag enumeration.
TApplicationFlag |  | Application state flags.
TCustomApplication.ShowException
Halt
Exception