{
  "code": null,
  "collection": "architecture",
  "href": "https://banes-lab.com/ontology#architecture-exception-control-flow",
  "id": "exception-control-flow",
  "kind": "anti-pattern",
  "layer": {
    "href": "https://banes-lab.com/ontology/schema#layer-enforcement-core",
    "json": "https://banes-lab.com/json/records/layer/enforcement-core",
    "label": "Enforcement Core",
    "markdown": "https://banes-lab.com/records/layer/enforcement-core.md",
    "ref": "layer:enforcement-core"
  },
  "name": "Exception Control Flow",
  "ref": "architecture:exception-control-flow",
  "relations": [
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-introduce-typed-result",
          "json": "https://banes-lab.com/json/records/lexicon/introduce-typed-result",
          "label": "Introduce Typed Result",
          "markdown": "https://banes-lab.com/records/lexicon/introduce-typed-result.md",
          "ref": "lexicon:introduce-typed-result"
        },
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-precondition-check",
          "json": "https://banes-lab.com/json/records/lexicon/precondition-check",
          "label": "Precondition Check",
          "markdown": "https://banes-lab.com/records/lexicon/precondition-check.md",
          "ref": "lexicon:precondition-check"
        }
      ],
      "relation": "refactored-by"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/schema#vocabulary-severity-discouraged",
          "json": "https://banes-lab.com/json/records/vocabulary/severity-discouraged",
          "label": "discouraged",
          "markdown": "https://banes-lab.com/records/vocabulary/severity-discouraged.md",
          "ref": "vocabulary:severity-discouraged"
        }
      ],
      "relation": "severity"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology#architecture-category-anti-patterns",
          "json": "https://banes-lab.com/json/records/architecture-category/anti-patterns",
          "label": "Anti-patterns",
          "markdown": "https://banes-lab.com/records/architecture-category/anti-patterns.md",
          "ref": "architecture-category:anti-patterns"
        }
      ],
      "relation": "category"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology/schema#force-correctness-verification",
          "json": "https://banes-lab.com/json/records/force/correctness-verification",
          "label": "Correctness verification",
          "markdown": "https://banes-lab.com/records/force/correctness-verification.md",
          "ref": "force:correctness-verification"
        }
      ],
      "relation": "force"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/ontology#architecture-error-handling",
          "json": "https://banes-lab.com/json/records/architecture/error-handling",
          "label": "Error Handling",
          "markdown": "https://banes-lab.com/records/architecture/error-handling.md",
          "ref": "architecture:error-handling"
        }
      ],
      "relation": "negated-by"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/software-architecture/principles#execution-joins-the-halves",
          "json": "https://banes-lab.com/json/software-architecture/principles/execution-joins-the-halves",
          "label": "Execution joins the halves",
          "markdown": "https://banes-lab.com/software-architecture/principles/execution-joins-the-halves.md",
          "ref": "chapter:/software-architecture/principles#execution-joins-the-halves"
        },
        {
          "href": "https://banes-lab.com/ontology#architecture-category-anti-patterns",
          "json": "https://banes-lab.com/json/ontology/principles/architecture-category-anti-patterns",
          "label": "Anti-patterns",
          "markdown": "https://banes-lab.com/ontology/principles/architecture-category-anti-patterns.md",
          "ref": "chapter:/ontology#architecture-category-anti-patterns"
        },
        {
          "href": "https://banes-lab.com/ontology#architecture-category-error-handling-resilience",
          "json": "https://banes-lab.com/json/ontology/principles/architecture-category-error-handling-resilience",
          "label": "Error Handling / Resilience",
          "markdown": "https://banes-lab.com/ontology/principles/architecture-category-error-handling-resilience.md",
          "ref": "chapter:/ontology#architecture-category-error-handling-resilience"
        },
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-category-correctness-determinism-verification",
          "json": "https://banes-lab.com/json/ontology/lexicon/lexicon-category-correctness-determinism-verification",
          "label": "Correctness / Determinism / Verification",
          "markdown": "https://banes-lab.com/ontology/lexicon/lexicon-category-correctness-determinism-verification.md",
          "ref": "chapter:/ontology/lexicon#lexicon-category-correctness-determinism-verification"
        },
        {
          "href": "https://banes-lab.com/ontology/lexicon#lexicon-category-error-handling-resilience",
          "json": "https://banes-lab.com/json/ontology/lexicon/lexicon-category-error-handling-resilience",
          "label": "Error Handling / Resilience",
          "markdown": "https://banes-lab.com/ontology/lexicon/lexicon-category-error-handling-resilience.md",
          "ref": "chapter:/ontology/lexicon#lexicon-category-error-handling-resilience"
        },
        {
          "href": "https://banes-lab.com/ontology/schema#the-vocabulary-severity",
          "json": "https://banes-lab.com/json/ontology/schema/the-vocabulary-severity",
          "label": "Severity levels",
          "markdown": "https://banes-lab.com/ontology/schema/the-vocabulary-severity.md",
          "ref": "chapter:/ontology/schema#the-vocabulary-severity"
        },
        {
          "href": "https://banes-lab.com/ontology/schema#the-forces",
          "json": "https://banes-lab.com/json/ontology/schema/the-forces",
          "label": "The forces",
          "markdown": "https://banes-lab.com/ontology/schema/the-forces.md",
          "ref": "chapter:/ontology/schema#the-forces"
        }
      ],
      "relation": "linked-from"
    }
  ],
  "summary": "A defect in which exceptions carry expected branching or normal absence.",
  "siblings": {
    "next": {
      "href": "https://banes-lab.com/ontology#architecture-null-semantics-drift",
      "json": "https://banes-lab.com/json/records/architecture/null-semantics-drift",
      "label": "Null Semantics Drift",
      "markdown": "https://banes-lab.com/records/architecture/null-semantics-drift.md",
      "ref": "architecture:null-semantics-drift"
    },
    "previous": {
      "href": "https://banes-lab.com/ontology#architecture-inconsistent-error-model",
      "json": "https://banes-lab.com/json/records/architecture/inconsistent-error-model",
      "label": "Inconsistent Error Model",
      "markdown": "https://banes-lab.com/records/architecture/inconsistent-error-model.md",
      "ref": "architecture:inconsistent-error-model"
    }
  },
  "up": {
    "href": null,
    "json": "https://banes-lab.com/json/api/records/architecture",
    "label": "Architecture principles",
    "markdown": "https://banes-lab.com/api/records/architecture.md",
    "ref": "api:records/architecture"
  },
  "aliases": [],
  "exemplar": {
    "after": "const foo = await fooStore.find(id);\nreturn foo ?? fooStore.create(id);",
    "before": "try {\n  return await fooStore.find(id);\n} catch (notFound) {\n  return fooStore.create(id);\n}",
    "lang": "ts",
    "medium": "code"
  },
  "formedBy": "Use exceptions for expected branching, normal absence, validation alternatives, or loop control.",
  "scope": [
    "correctness_verification"
  ],
  "severity": "discouraged"
}
