This commit is contained in:
lesion 2021-10-21 12:18:25 +02:00
parent 02e737e074
commit 396b66e436
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -28,11 +28,11 @@ class Task {
try {
const ret = this.method.apply(this, this.args)
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
}
} catch (e) {
log.error('TASK ERROR [%s]: %s ', this.name, e)
log.error(`TASK ERROR [${this.name}]: ${e} ${e.stack}`)
return Promise.resolve(false)
}
}