This commit is contained in:
lesion
2021-10-21 12:18:25 +02:00
parent 02e737e074
commit 396b66e436

View File

@@ -28,11 +28,11 @@ class Task {
try { try {
const ret = this.method.apply(this, this.args) const ret = this.method.apply(this, this.args)
if (ret && typeof ret.then === 'function') { if (ret && typeof ret.then === 'function') {
ret.catch(e => log.error('TASK ERROR [%s]: %s', this.name, e)) ret.catch(e => log.error(`TASK ERROR [${this.name}]: ${e} ${e.stack}`))
return ret return ret
} }
} catch (e) { } catch (e) {
log.error('TASK ERROR [%s]: %s ', this.name, e) log.error(`TASK ERROR [${this.name}]: ${e} ${e.stack}`)
return Promise.resolve(false) return Promise.resolve(false)
} }
} }