<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "BitcoinKernel",
  "identifier" : "/documentation/BitcoinKernel/BlockSourceError",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "BitcoinKernel"
    ],
    "preciseIdentifier" : "s:13BitcoinKernel16BlockSourceErrorO"
  },
  "title" : "BlockSourceError"
}
-->

# BlockSourceError

Errors thrown by [`BlockSource`](/documentation/BitcoinKernel/BlockSource) conformers.

```
enum BlockSourceError
```

## Overview

Covers the five common failure modes of fetching blockchain data from a
remote source: malformed responses, missing data, unsupported operations,
rate-limiting, and transport-layer failures. Designed so that a single
`catch let error as BlockSourceError` in calling code is sufficient to
handle every source-side failure category.

Inside [`BlockchainSync`](/documentation/BitcoinKernel/BlockchainSync), any `BlockSourceError` thrown from a conformer
is re-surfaced to the caller as a terminal
[`BlockchainSync.Update.State.failed(_:)`](/documentation/BitcoinKernel/BlockchainSync/Update/State-swift.enum/failed(_:)) update carrying the
error’s localized description — the sequence itself does not throw.