Skip to content

Exception Handling Tactic

Exception handling is an availability tactic. It sits under “Recover from Faults”, in the subcategory “Preparation and Repair”. When the system detects an exception, it deals with it by reporting it or handling it.

An exception here is a condition that alters the normal flow of execution. Spotting that condition is a separate tactic, called exception detection. It belongs to the “Detect Faults” group. So detection comes first, and handling is the recovery step that follows. See Fault Detection Tactic and Fault Recovery Tactic.

Other detection tactics also lead into handling:

  • Heartbeat: a monitor and a monitored process swap periodic messages.
  • Ping/Echo: nodes exchange an asynchronous request and response pair.

These tactics find the fault. Exception handling responds once a fault is found.

Handling can also lead to a reduced mode of operation. Graceful Degradation is a related tactic in the same group. It keeps the most critical functions running during failures and drops less critical ones.

Error handling is also a documentation topic. The arc42 method asks cross-cutting concepts to answer how the system and its building blocks handle errors and exceptions. Such technical concepts are written for developers, briefly and by priority. See Crosscutting Concept.

A monitoring component notices that a worker process has stopped answering its periodic messages. That is the detection step. An exception handler then records the problem and reports it to operators. The system keeps running its most important functions and pauses the optional ones until the worker returns.

Detection leads to handling, which reports or handles the exception.

Diagram source
flowchart LR
A[Fault occurs] --> B[Exception detection]
B --> C[Exception handling]
C --> D[Report]
C --> E[Handle]
E --> F[Reduced mode of operation]
  • The document states how the system and its building blocks handle errors and exceptions.
  • Technical error handling concepts are written for developers, briefly and by priority.
  • Exception handling is tied to a detection mechanism such as heartbeat or ping/echo.