Fix die handle

This commit is contained in:
lowlighter
2020-10-26 19:53:25 +01:00
parent 16c2cc3376
commit a97b327428
2 changed files with 4 additions and 2 deletions

View File

@@ -737,6 +737,7 @@ var external_url_default = /*#__PURE__*/__webpack_require__.n(external_url_);
console.debug(`plugin ${name} ${result ? result.error ? "failed" : "success" : "ignored"} : ${JSON.stringify(result).replace(/^(.{888}).+/, "$1...")}`)
if (die) {
const errors = promised.filter(({result = null}) => !!result?.error).length
if (errors)
throw new Error(`${errors} error${s(errors)} found...`)
}

View File

@@ -52,6 +52,7 @@
console.debug(`plugin ${name} ${result ? result.error ? "failed" : "success" : "ignored"} : ${JSON.stringify(result).replace(/^(.{888}).+/, "$1...")}`)
if (die) {
const errors = promised.filter(({result = null}) => !!result?.error).length
if (errors)
throw new Error(`${errors} error${s(errors)} found...`)
}