From 582d8807d276f83ad9f19f5c96e390ee1c510ae0 Mon Sep 17 00:00:00 2001 From: Dan Ordille Date: Fri, 10 Aug 2018 12:47:15 -0400 Subject: [PATCH] fix(core): catch errors when parsing chunkerstring and return error pull stream License: MIT Signed-off-by: Dan Ordille --- src/core/components/files.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/components/files.js b/src/core/components/files.js index 48e4228f7f..e807188a5b 100644 --- a/src/core/components/files.js +++ b/src/core/components/files.js @@ -135,7 +135,12 @@ class AddHelper extends Duplex { module.exports = function files (self) { function _addPullStream (options = {}) { - const chunkerOptions = parseChunkerString(options.chunker) + let chunkerOptions + try { + chunkerOptions = parseChunkerString(options.chunker) + } catch (err) { + return pull.map(() => { throw err }) + } const opts = Object.assign({}, { shardSplitThreshold: self._options.EXPERIMENTAL.sharding ? 1000