Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.9.2
Framework Version
"@sentry/node": "^8.9.2"
Link to Sentry event
No response
SDK Setup
init({
dsn: '___DSN',
tracesSampleRate: 0.1,
profilesSampleRate: 1.0,
normalizeDepth: 11,
integrations: [nodeProfilingIntegration],
environment: EnvVariablesUtility.NODE_ENV,
enabled: EnvVariablesUtility.NODE_ENV !== 'local',
beforeSend(event, hint) {
const error: any = hint.originalException;
if (error && error.expose) {
return null;
}
return event;
},
});
Steps to Reproduce
My middleware:
ctx.status = 201;
ctx.assert(isEmail.default(email), 400, 'The email is invalid');
Expected Result
Status code to be 400 with body text 'The email is invalid'
Actual Result
Status code is 201, body text is 'Created'
However, if I place setupKoaErrorHandler
after I have defined all my middlewares, I get
Status code 400, no body
Metadata
Metadata
Assignees
Type
Projects
Status
No status