In computer programming, an exception is a special condition encountered during program execution that is unexpected or anomalous. For example, if a program tries to open a file that doesn’t exist or gets a read error, this condition is an exception.

Exceptions must be anticipated by the programmer and properly handled in the program code, branching program execution as appropriate to avoid a fatal error. This aspect of computer programming is known as exception handling.

Fatal exception, Programming terms

  • How to fix a fatal exception error.