# Inconsistent Error Model

> A defect in which one class of failure is reported through several incompatible shapes.

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

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Ambient Context](https://banes-lab.com/records/architecture/ambient-context.md) and before [Exception Control Flow](https://banes-lab.com/records/architecture/exception-control-flow.md).

## Repair

- Refactored by: typed_result, standard_error_contract, [error_boundary](https://banes-lab.com/records/algorithms/error-boundary.md), normalize_failure_modes
- Detected by: same_error_returns_null_or_throws, mixed_error_shapes, string_errors, partial_success_without_contract
- Violated by: Mix exceptions, nulls, booleans, strings, partial objects, console logging, and silent failure for the same error class.
- Measured by: distinct error shapes per error class
- Enforced by: a typed error contract held by the type checker, lint rules against thrown strings

## 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

- [Model governance](https://banes-lab.com/records/force/model-governance.md)

## Negated by

- [Semantic Consistency](https://banes-lab.com/records/architecture/semantic-consistency.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)
- [Schema / Canonical Data / Semantics](https://banes-lab.com/ontology/principles/architecture-category-schema-canonical-data-semantics.md)
- [Core Vocabulary](https://banes-lab.com/ontology/lexicon/lexicon-category-core-vocabulary.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The forces](https://banes-lab.com/ontology/schema/the-forces.md)
