Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 30ea824

Browse files
dordillealanshaw
authored andcommitted
fix(core): catch errors when parsing chunkerstring and return error pull stream
License: MIT Signed-off-by: Dan Ordille <[email protected]>
1 parent 819d7b3 commit 30ea824

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/core/components/files.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,12 @@ class AddHelper extends Duplex {
149149

150150
module.exports = function files (self) {
151151
function _addPullStream (options = {}) {
152-
const chunkerOptions = parseChunkerString(options.chunker)
152+
let chunkerOptions
153+
try {
154+
chunkerOptions = parseChunkerString(options.chunker)
155+
} catch (err) {
156+
return pull.map(() => { throw err })
157+
}
153158
const opts = Object.assign({}, {
154159
shardSplitThreshold: self._options.EXPERIMENTAL.sharding
155160
? 1000

0 commit comments

Comments
 (0)