before changes

This commit is contained in:
2026-10-05 16:14:53 -04:00
parent dd6e6f7cfd
commit f39555ce15
94 changed files with 3285321 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
const Bugsnag = require('@bugsnag/js')
const DEV_APP_ENVS = ['local-dev', 'development']
const handleError = (err, user) => {
const isDevEnv = DEV_APP_ENVS.includes(process.env.POTION_APP_ENV)
if (isDevEnv) {
return
}
if (user)
Bugsnag.notify(err, function (event) {
event.setUser(user._id, user.email, user.name)
})
else Bugsnag.notify(err)
}
module.exports = handleError