Description
I am using Node v10.15.2 + Express v4.16.3 and "@sentry/node" v5.1
Hoping someone can help. Sentry is reporting Errors with incorrect data.
Sentry reported an error today that can only come from 1 specific route in my API. That route is /dashboard/memberships
It's a validation error from Mongo (that's besides the point though).
However, Sentry reported the Error originating from an entirely different route /site/settings
and includes data that is intended for the '/site/settings' route.
Looking at my raw server logs, the error was logged along side a request to /dashboard/memberships
Which confirms to me at least the error actually did come from that route; and like I said, it's a very specific error that can only originate from the /dashboard/memberships
Here is a simplified version of my entry point:
Sentry.init({ environment: "my enviroment", dsn: 'hi github' })
const app = express()
app.use(Sentry.Handlers.requestHandler())
// error actually came from route inside here
app.use('/dashboard', dashboard) // my dashboard routes
// but sentry thinks it came from here
app.use('/site', sites) // my sites routes
app.use(Sentry.Handlers.errorHandler())
app.use(function(err,req,res,next) {
if (err) {
console.log(err)
if (res.headersSent === false) {
res.sendStatus(400)
}
}
next()
})
I can provide more info if needed. Thanks!