Skip to content

Nestjs integration reports 404 errors to sentry #12523

Closed
@strongpauly

Description

@strongpauly

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

8.9.2

Framework Version

No response

Link to Sentry event

https://zero1.sentry.io/issues/5500224353/events/?alert_rule_id=11637924&alert_type=issue&notification_uuid=5695e46f-daeb-45f7-b17a-c7b757adad3c&project=6391861&referrer=slack

SDK Setup

Sentry.init({
        dsn: dsn,
        attachStacktrace: true,
        release: release,
        environment: enviroment,
        serverName: serverName
})

Steps to Reproduce

  1. Bootstrap app as described in the documentation:
async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  const { httpAdapter } = app.get(HttpAdapterHost);

  Sentry.setupNestErrorHandler(app, new BaseExceptionFilter(httpAdapter));

  await app.listen(3000);
}
  1. Send a request to the server which results in a NotFoundException or 404

Expected Result

Server should respond with a 404 error and this error should not be sent to Sentry as its expected behaviour.

Actual Result

Event is reported and devs get a notification causing noise.

Metadata

Metadata

Assignees

Labels

Package: nodeIssues related to the Sentry Node SDK

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions