Skip to content

Commit

Permalink
Catch errors of slack requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzyis committed Sep 13, 2023
1 parent 0810dad commit 0b4e285
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pages/api/log/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default async (req, res) => {

const { id } = await models.log.create({ data: { level: level.toUpperCase(), name, message, env, context } })

slackPostMessage({ id, ...req.body })
slackPostMessage({ id, ...req.body }).catch(console.error)

return res.status(200).json({ status: 200, message: 'ok' })
}

0 comments on commit 0b4e285

Please sign in to comment.