T51 Dec 24, 2025 2 min read

Error

An incorrect or unexpected condition in a system. An exception is one mechanism for representing or propagating errors.

Definition

An error is an incorrect or unexpected condition in a system.

Errors can be represented in different ways depending on the language and context: return values, result types, status codes, logs, or exceptions.

Error vs exception

An exception is a control-flow mechanism.

An error is the condition you are trying to represent and handle.