-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed as not planned
Labels
Meta: Help WantedPackage: serverlessIssues related to the Sentry Serverless SDKIssues related to the Sentry Serverless SDKStaleType: Improvementhacktoberfest
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 package are you using?
@sentry/angular
SDK Version
7.34.0
Framework Version
4.17.6
Link to Sentry event
SDK Setup
global.process.on('uncaughtException', (error) => {
});
const sentryOptions = {
environment: config.APP_ENV === 'DEV'
? 'development'
: (
config.APP_ENV.includes('ALPHA')
? 'alpha'
: (config.APP_ENV === 'BETA' ? 'beta' : 'production')
),
dsn: config.LOGS_SENTRY_DSN,
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 0.25,
integrations: integrations => {
const newIntegrations = integrations.filter(integration =>
integration.name !== 'OnUncaughtException' &&
integration.name !== 'Http' &&
integration.name !== 'LocalVariables'
);
newIntegrations.push(
new Sentry.Integrations.OnUncaughtException({exitEvenIfOtherHandlersAreRegistered: false}),
new Sentry.Integrations.Http({tracing: true}),
new Sentry.Integrations.LocalVariables({
captureAllExceptions: true,
})
);
if (app) {
newIntegrations.push(
// enable Express.js middleware tracing
new Tracing.Integrations.Express({app}),
);
}
return newIntegrations;
},
beforeSend: function(event, hint) {
return event;
}
};
Sentry.init(sentryOptions);Steps to Reproduce
I noticed this nasty issue on my winston implementation as well.
aws-sdk errors come in as Error type but for some reason they simply do not work properly so in my old winston logger I overcame it with converting the error to a new Error when I got it.
This is a quick basic hack I did:
if (err instanceof Error && err.requestId) {
// This is a workaround for errors that have custom
// properties, like AWS SDK errors, they do not seem to work
// with Winston `winston.format.errors({stack: true})` so
// we copy the error object to a new fresh error object which seems to work
const errc = new Error(err.message);
errc.stack = err.stack;
err = errc;
req.error(err);
}
Expected Result
The error comes in as shown in the linked error, this was from me manually hacking around the issue
Actual Result
Error not logged at all as shown by no console.log in beforeSend
Metadata
Metadata
Assignees
Labels
Meta: Help WantedPackage: serverlessIssues related to the Sentry Serverless SDKIssues related to the Sentry Serverless SDKStaleType: Improvementhacktoberfest
Projects
Status
Waiting for: Community