improve logs

This commit is contained in:
les 2021-07-09 21:42:38 +02:00
parent 2fc05fd0ed
commit 49301de42d
No known key found for this signature in database
GPG key ID: 352918250B012177
2 changed files with 4 additions and 4 deletions

View file

@ -34,20 +34,20 @@ const announceController = {
announce = await announce.update(announceDetails)
res.json(announce)
} catch (e) {
log.error('Toggle announcement failed: %s ', e)
log.error('Toggle announcement failed', e)
res.sendStatus(404)
}
},
async remove (req, res) {
log.info('Remove announcement "%d"', req.params.announce_id)
log.info('Remove announcement', req.params.announce_id)
const announce_id = req.params.announce_id
try {
const announce = await Announcement.findByPk(announce_id)
await announce.destroy()
res.sendStatus(200)
} catch (e) {
log.error('Remove announcement failed: "%s" ', e)
log.error('Remove announcement failed:', e)
res.sendStatus(404)
}
}

View file

@ -159,7 +159,7 @@ const Helpers = {
return Instance.create({ name: instance.title, domain, data, blocked: false })
})
.catch(e => {
log.error(e)
log.error('[INSTANCE CREATE]', e)
return Instance.create({ name: domain, domain, blocked: false })
})
return instance