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

@@ -52,7 +52,8 @@
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
throw new Error(`${errors} error${s(errors)} found...`)
if (errors)
throw new Error(`${errors} error${s(errors)} found...`)
}
//Template rendering