---
slug: "Exception"
name: "Exception"
type: "Data Structures"
layer: "Infrastructure"
ref: "Exception#ae94"
sema_id: "sema:Exception#mh:SHA-256:ae9485039008abed9587e74c05a8c31c37d9a8f70347a11c0630fe87673fb7bb"
tags: ["Infrastructure","Data Structures"]
updated: 2026-11-11
mindscape: "bootstrap"
index_url: https://mindscape.world/scapes/bootstrap.json
url: https://mindscape.world/bootstrap/Exception/
related: ["CircuitBreaker","FailClosed","State","TaskLifecycle"]
---

# Exception

Runtime anomaly signal

Layer: Infrastructure · Category: Data Structures

## Mechanism

A signal indicating that the standard execution flow has encountered a critical anomaly or invalid [State](https://mindscape.world/scapes/bootstrap/State.md). Must be handled explicitly by a [CircuitBreaker](https://mindscape.world/scapes/bootstrap/CircuitBreaker.md) or [FailClosed](https://mindscape.world/scapes/bootstrap/FailClosed.md) policy to prevent system corruption.

## Invariants

- Classifies the anomaly by `error_code`.
- Must be handled by [CircuitBreaker](https://mindscape.world/scapes/bootstrap/CircuitBreaker.md) or [FailClosed](https://mindscape.world/scapes/bootstrap/FailClosed.md), never merely observed.

## Failure modes

- Swallowed: the signal is caught and discarded, so the invalid [State](https://mindscape.world/scapes/bootstrap/State.md) continues unhandled.
- Over-broad code: one `error_code` covers unrelated anomalies, so no handler can dispatch on it.

## Data schema

```json
{
  "type": "object",
  "required": [
    "error_code",
    "message"
  ],
  "properties": {
    "error_code": {
      "type": "string",
      "description": "Standardized failure ID"
    },
    "message": {
      "type": "string",
      "description": "Human-readable description"
    },
    "stack_trace": {
      "type": "array",
      "description": "Execution context at failure"
    },
    "severity": {
      "type": "string",
      "enum": [
        "Fatal",
        "Error",
        "Warning"
      ]
    }
  }
}
```

## Builds on

- [CircuitBreaker](https://mindscape.world/scapes/bootstrap/CircuitBreaker.md) (Infrastructure; References)
- [FailClosed](https://mindscape.world/scapes/bootstrap/FailClosed.md) (Infrastructure; References)
- [State](https://mindscape.world/scapes/bootstrap/State.md) (Infrastructure; References)

## Used by

- [TaskLifecycle](https://mindscape.world/scapes/bootstrap/TaskLifecycle.md) (Infrastructure; References)

## Identity

- Sema ID: `sema:Exception#mh:SHA-256:ae9485039008abed9587e74c05a8c31c37d9a8f70347a11c0630fe87673fb7bb`
- Ref: `Exception#ae94`
- Supersedes:
  - `sema:Exception#mh:SHA-256:bcdc11a8b6e4c1af2def02029ab03bf24c1480bd827ee3d570e374096cfccdc6`
  - `sema:Exception#mh:SHA-256:39fb7ba646e5c1dc91699ae4b3dc0887f4ec476fe6bf29970b83aaaca025f686`
  - `sema:Exception#mh:SHA-256:054ce28455dfd0a13bce0b5a23e048429a58a1b7e6c9082252bc3f815fe6be21`
  - `sema:Exception#mh:SHA-256:61e41a9f4e26dad1ab09516b35640c6204e99e7d1df29ce0899bcbb24a126e1d`
  - `sema:Exception#mh:SHA-256:7c68ca1c9f4cae08d081d6fd31a667fa16a67d2de79eae1a96b196ad69bb9869`

## Links

- [Pattern page](https://mindscape.world/bootstrap/Exception/)
- [View in the interactive graph](https://mindscape.world/bootstrap/#Exception)
- [JSON](https://mindscape.world/scapes/bootstrap/Exception.json)
- [Index of all patterns](https://mindscape.world/scapes/bootstrap.json)
