Logs plugins errors as warning even if debug option isn't enabled
This commit is contained in:
@@ -58,10 +58,16 @@
|
||||
const promised = await Promise.all(pending)
|
||||
|
||||
//Check plugins errors
|
||||
if (die) {
|
||||
const errors = promised.filter(({result = null}) => !!result?.error).length
|
||||
if (errors)
|
||||
throw new Error(`${errors} error${s(errors)} found...`)
|
||||
{
|
||||
const errors = promised.filter(({result = null}) => result?.error)
|
||||
if (die) {
|
||||
if (errors.length)
|
||||
throw new Error(`${errors.length} error${s(errors.length)} found...`)
|
||||
}
|
||||
else {
|
||||
console.warn(`${errors.length} error${s(errors.length)} found, ignoring...`)
|
||||
console.warn(util.inspect(errors, {depth:Infinity, maxStringLength:256}))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
if ((!enabled)||(!q.habits))
|
||||
return null
|
||||
//Parameters override
|
||||
let {"habits.from":from = defaults.from ?? 500, "habits.days":days = 30, "habits.facts":facts = true, "habits.charts":charts = false} = q
|
||||
let {"habits.from":from = defaults.from ?? 500, "habits.days":days = 14, "habits.facts":facts = true, "habits.charts":charts = false} = q
|
||||
//Events
|
||||
from = Math.max(1, Math.min(1000, Number(from)))
|
||||
//Days
|
||||
|
||||
Reference in New Issue
Block a user