nest-raven
nest-raven copied to clipboard
How to log errors/message manually
In sentry JS package we were able to use Sentry.captureException
or Sentry.captureMessage
to capture any exceptions or messages outside of fatal errors. In your package only example I see here is capturing an Exception:
https://github.com/mentos1386/nest-raven/tree/master/example/src
Most of the time we want to use try/catch to handle exceptions and then log those handled exceptions for example:
try {
// some exception raised here
} catch(e) {
Sentry.captureException(e);
}
Is it possible to do the same with nest-raven package or your package just capture fatal errors and exceptions and we will need to use core sentry package to capture exceptions and messages?
I am curious about this too. We're switching from https://www.npmjs.com/package/@ntegral/nestjs-sentry (as it seem unmaintained / buggy).
However, that package has a really nice way to inject the sentry module into services
Basically this one feature is what's holding me back from using it
Hmm - I ended up just doing this:
import * as Sentry from '@sentry/node';
Sentry.captureMessage('Less than 3 profiles returned from relevantDatingProfiles', 'warning');
And it seems to work just fine! 😊
thanks for this note @simplenotezy! We were also looking at nestjs-sentry and seems a bit too inflexible for us. We need ot be able to use tracing and such as well.
Hey all. What @simplenotezy recommends is an acceptable and expected solution for use with this library. This library is not trying to support all the features from sentry, but just the graphql/rest integration with NestJS.
For other features, the plain @sentry/node
should be used, as it would be pointless for us to re-write or wrap all the functionality it provides.
I'm closing this as not planned.