Skip to content

Commit 83cd0d5

Browse files
committed
ref(aws-serverless): Add type to captured event mechanism
1 parent 12ac49a commit 83cd0d5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/aws-serverless/src/sdk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,11 @@ export function wrapHandler<TEvent, TResult>(
306306
if (options.captureAllSettledReasons && Array.isArray(rv) && isPromiseAllSettledResult(rv)) {
307307
const reasons = getRejectedReasons(rv);
308308
reasons.forEach(exception => {
309-
captureException(exception, scope => markEventUnhandled(scope));
309+
captureException(exception, scope => markEventUnhandled(scope, 'aws-serverless.promise'));
310310
});
311311
}
312312
} catch (e) {
313-
captureException(e, scope => markEventUnhandled(scope));
313+
captureException(e, scope => markEventUnhandled(scope, 'aws-serverless.handler'));
314314
throw e;
315315
} finally {
316316
clearTimeout(timeoutWarningTimer);

packages/aws-serverless/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ const headerGetter: TextMapGetter<APIGatewayProxyEventHeaders> = {
2626
/**
2727
* Marks an event as unhandled by adding a span processor to the passed scope.
2828
*/
29-
export function markEventUnhandled(scope: Scope): Scope {
29+
export function markEventUnhandled(scope: Scope, type = 'aws-serverless'): Scope {
3030
scope.addEventProcessor(event => {
31-
addExceptionMechanism(event, { handled: false });
31+
addExceptionMechanism(event, { handled: false, type });
3232
return event;
3333
});
3434

0 commit comments

Comments
 (0)