From a5eb1e75f5fdb5cab1e285117f056f5970af3910 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 8bf66eb972..d575d893fa 100644 --- a/src/core/components/files.js +++ b/src/core/components/files.js @@ -150,7 +150,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