Verified Commit 49301de4 authored by les's avatar les
Browse files

improve logs

parent 2fc05fd0
......@@ -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)
}
}
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment