# Exception Control Flow

> A defect in which exceptions carry expected branching or normal absence.

Record: `architecture:exception-control-flow`
Kind: anti-pattern
Layer: [Enforcement Core](https://banes-lab.com/records/layer/enforcement-core.md)
Severity: discouraged
Scope: correctness_verification
Canonical: https://banes-lab.com/ontology#architecture-exception-control-flow

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Inconsistent Error Model](https://banes-lab.com/records/architecture/inconsistent-error-model.md) and before [Null Semantics Drift](https://banes-lab.com/records/architecture/null-semantics-drift.md).

## Repair

- Refactored by: return_result_type, use_option_type, validate_before_call, branch_explicitly
- Detected by: try_catch_for_lookup_absence, exceptions_in_hot_loop, catch_chooses_normal_path
- Violated by: Use exceptions for expected branching, normal absence, validation alternatives, or loop control.
- Measured by: catch blocks on expected-absence paths
- Enforced by: lint rules against catch blocks that choose the normal path

## Severity

- [discouraged](https://banes-lab.com/records/vocabulary/severity-discouraged.md)

## Category

- [Anti-patterns](https://banes-lab.com/records/architecture-category/anti-patterns.md)

## Force

- [Correctness verification](https://banes-lab.com/records/force/correctness-verification.md)

## Negated by

- [Error Handling](https://banes-lab.com/records/architecture/error-handling.md)

## Linked from

- [Execution joins the halves](https://banes-lab.com/software-architecture/principles/execution-joins-the-halves.md)
- [Anti-patterns](https://banes-lab.com/ontology/principles/architecture-category-anti-patterns.md)
- [Error Handling / Resilience](https://banes-lab.com/ontology/principles/architecture-category-error-handling-resilience.md)
- [Error Handling / Resilience](https://banes-lab.com/ontology/lexicon/lexicon-category-error-handling-resilience.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The forces](https://banes-lab.com/ontology/schema/the-forces.md)
