Skip to content
New issue

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

Base Errors are not captured #11

Closed
iteratelance opened this issue Aug 15, 2020 · 1 comment
Closed

Base Errors are not captured #11

iteratelance opened this issue Aug 15, 2020 · 1 comment

Comments

@iteratelance
Copy link

iteratelance commented Aug 15, 2020

When throwing an error that is other than, http, rpc, or ws no exception is captured. For example if I bootstrap the app and call a service, i.e. for a background task, per the docs https://docs.nestjs.com/standalone-applications

const app = await NestFactory.create(AppModule);
app.get(MyService).doSomething();

Reviewing the code here https://github.com/ntegral/nestjs-sentry/blob/master/lib/services/sentry.interceptor.ts#L18 I see that there is case logic that has no fallback to handle ordinary node.js errors. Again these errors might occur when services are called outside the context of an http request, like a background task so would be good to call captureException as a default https://github.com/ntegral/nestjs-sentry/blob/master/lib/services/sentry.interceptor.ts#L81

Perhaps this is a limitation of NestJs interceptor error handling and regular Errors are not caught?

Side bar, and not related would be nice to have an AWSLambda integration that is compatible with your module or at least an option to flush immediately. As the default sentry plugin does not work on AWS because it must flush.

Sentry.captureException(error);
Sentry.flush();
@ntegral
Copy link
Owner

ntegral commented Jan 15, 2021

These options have been added in the latest update version 1.0.5. All of the base method implementations have been added to the service. Before they were available and could only be accessed via the "client.instance().flush" etc. now once you instantiate the client you can access them directly "client.flush()" etc.

@ntegral ntegral closed this as completed Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants