@helia/utils 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +3 -3
- package/dist/src/errors.d.ts +5 -1
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +7 -3
- package/dist/src/errors.js.map +1 -1
- package/dist/src/graph-walker.d.ts +4 -1
- package/dist/src/graph-walker.d.ts.map +1 -1
- package/dist/src/graph-walker.js +54 -72
- package/dist/src/graph-walker.js.map +1 -1
- package/dist/src/utils/datastore-version.js +2 -2
- package/dist/src/utils/datastore-version.js.map +1 -1
- package/dist/src/utils/networked-storage.d.ts.map +1 -1
- package/dist/src/utils/networked-storage.js +4 -0
- package/dist/src/utils/networked-storage.js.map +1 -1
- package/package.json +1 -1
- package/src/errors.ts +8 -3
- package/src/graph-walker.ts +64 -84
- package/src/utils/datastore-version.ts +2 -2
- package/src/utils/networked-storage.ts +5 -0
|
@@ -5,6 +5,7 @@ import filter from 'it-filter'
|
|
|
5
5
|
import forEach from 'it-foreach'
|
|
6
6
|
import { CustomProgressEvent } from 'progress-events'
|
|
7
7
|
import { equals as uint8ArrayEquals } from 'uint8arrays/equals'
|
|
8
|
+
import { InvalidConfigurationError } from '../errors.ts'
|
|
8
9
|
import { isPromise } from './is-promise.js'
|
|
9
10
|
import type { HasherLoader } from '@helia/interface'
|
|
10
11
|
import type { BlockBroker, Blocks, Pair, DeleteManyBlocksProgressEvents, DeleteBlockProgressEvents, GetBlockProgressEvents, GetManyBlocksProgressEvents, PutManyBlocksProgressEvents, PutBlockProgressEvents, GetAllBlocksProgressEvents, GetOfflineOptions, BlockRetrievalOptions, CreateSessionOptions, SessionBlockstore } from '@helia/interface/blocks'
|
|
@@ -446,6 +447,10 @@ async function raceBlockRetrievers (cid: CID, blockBrokers: BlockBroker[], hashe
|
|
|
446
447
|
}
|
|
447
448
|
}
|
|
448
449
|
|
|
450
|
+
if (retrievers.length === 0) {
|
|
451
|
+
throw new InvalidConfigurationError(`No block brokers capable of retrieving blocks are configured, the CID ${cid} cannot be fetched from the network`)
|
|
452
|
+
}
|
|
453
|
+
|
|
449
454
|
try {
|
|
450
455
|
return await Promise.any(
|
|
451
456
|
retrievers
|