Skip to content

Commit 1a728a6

Browse files
committed
Remove ignoreSentryErrors option
1 parent 9e0a382 commit 1a728a6

File tree

3 files changed

+1
-40
lines changed

3 files changed

+1
-40
lines changed

MIGRATION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ For our efforts to reduce bundle size of the SDK we had to remove and refactor p
340340
- Remove `SDK_NAME` export from `@sentry/browser`, `@sentry/node`, `@sentry/tracing` and `@sentry/vue` packages.
341341
- Removed `eventStatusFromHttpCode` to save on bundle size.
342342
- Replace `BrowserTracing` `maxTransactionDuration` option with `finalTimeout` option
343+
- Removed `ignoreSentryErrors` option from AWS lambda SDK. Errors originating from the SDK will now *always* be caught internally.
343344

344345
## Sentry Angular SDK Changes
345346

packages/serverless/src/awslambda.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export interface WrapperOptions {
5454
* @default false
5555
*/
5656
captureAllSettledReasons: boolean;
57-
ignoreSentryErrors: boolean;
5857
}
5958

6059
export const defaultIntegrations: Integration[] = [...Sentry.defaultIntegrations, new AWSServices({ optional: true })];
@@ -226,7 +225,6 @@ export function wrapHandler<TEvent, TResult>(
226225
captureTimeoutWarning: true,
227226
timeoutWarningLimit: 500,
228227
captureAllSettledReasons: false,
229-
ignoreSentryErrors: true,
230228
...wrapOptions,
231229
};
232230
let timeoutWarningTimer: NodeJS.Timeout;

packages/serverless/test/awslambda.test.ts

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -178,44 +178,6 @@ describe('AWSLambda', () => {
178178
expect(Sentry.captureException).toHaveBeenNthCalledWith(2, error2);
179179
expect(Sentry.captureException).toBeCalledTimes(2);
180180
});
181-
182-
test('ignoreSentryErrors - with successful handler', async () => {
183-
const sentryError = new SentryError('HTTP Error (429)');
184-
jest.spyOn(Sentry, 'flush').mockRejectedValueOnce(sentryError);
185-
186-
const handledError = new Error('handled error, and we want to monitor it');
187-
const expectedSuccessStatus = { status: 'success', reason: 'we handled error, so success' };
188-
const handler = () => {
189-
Sentry.captureException(handledError);
190-
return Promise.resolve(expectedSuccessStatus);
191-
};
192-
const wrappedHandlerWithoutIgnoringSentryErrors = wrapHandler(handler, { ignoreSentryErrors: false });
193-
const wrappedHandlerWithIgnoringSentryErrors = wrapHandler(handler, { ignoreSentryErrors: true });
194-
195-
await expect(wrappedHandlerWithoutIgnoringSentryErrors(fakeEvent, fakeContext, fakeCallback)).rejects.toThrow(
196-
sentryError,
197-
);
198-
await expect(wrappedHandlerWithIgnoringSentryErrors(fakeEvent, fakeContext, fakeCallback)).resolves.toBe(
199-
expectedSuccessStatus,
200-
);
201-
});
202-
203-
test('ignoreSentryErrors - with failed handler', async () => {
204-
const sentryError = new SentryError('HTTP Error (429)');
205-
jest.spyOn(Sentry, 'flush').mockRejectedValueOnce(sentryError);
206-
207-
const criticalUnhandledError = new Error('critical unhandled error ');
208-
const handler = () => Promise.reject(criticalUnhandledError);
209-
const wrappedHandlerWithoutIgnoringSentryErrors = wrapHandler(handler, { ignoreSentryErrors: false });
210-
const wrappedHandlerWithIgnoringSentryErrors = wrapHandler(handler, { ignoreSentryErrors: true });
211-
212-
await expect(wrappedHandlerWithoutIgnoringSentryErrors(fakeEvent, fakeContext, fakeCallback)).rejects.toThrow(
213-
sentryError,
214-
);
215-
await expect(wrappedHandlerWithIgnoringSentryErrors(fakeEvent, fakeContext, fakeCallback)).rejects.toThrow(
216-
criticalUnhandledError,
217-
);
218-
});
219181
});
220182

221183
describe('wrapHandler() on sync handler', () => {

0 commit comments

Comments
 (0)