We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey there, Is there a way to access Sentry in app.ts to capture uncaught exceptions. please find the sample code below
//app.ts
import { INestApplication, NestApplicationOptions, ValidationPipe, BadRequestException, ValidationError, RequestMethod, } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; import { ExpressAdapter } from '@nestjs/platform-express'; import express from 'express'; import { AppModule } from './app.module'; import { ConfigService, isLocal } from './platform'; const ERROR_EXIT_CODE = 1; /* istanbul ignore next */ process .on('unhandledRejection', reason => { // eslint-disable-next-line no-console console.error(reason); Sentry.captureException(reason); process.exit(ERROR_EXIT_CODE); }) .on('uncaughtException', err => { // eslint-disable-next-line no-console console.error(err); Sentry.captureException(err); process.exit(ERROR_EXIT_CODE); }); export default async function createApp(): Promise<INestApplication> { const expressServer = express(); const httpAdapter = new ExpressAdapter(expressServer); const options: NestApplicationOptions = { logger: false, bodyParser: false }; const app: INestApplication = await NestFactory.create(AppModule, httpAdapter, options); const config = app.get(ConfigService); app.enableCors(); ); return app; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hey there,
Is there a way to access Sentry in app.ts to capture uncaught exceptions. please find the sample code below
//app.ts
The text was updated successfully, but these errors were encountered: