T50 Dec 24, 2025 2 min read

Exception

A language-level control-flow mechanism for handling abnormal situations by unwinding the call stack to a handler.

Definition

An exception is a language-level mechanism for signaling and handling abnormal situations.

When an exception is raised, execution typically jumps to the nearest matching handler, often by unwinding the call stack.

Exception vs error

An error is the underlying condition or problem.

An exception is one mechanism for representing or propagating that error.