MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / processResult

Function processResult

packages/aws-serverless/src/sdk.ts:227–255  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

225 timeoutWarningTimer = setupTimeoutWarning(context, options);
226
227 async function processResult(): Promise<TResult> {
228 const scope = getCurrentScope();
229
230 let rv: TResult;
231 try {
232 enhanceScopeWithEnvironmentData(scope, context, START_TIME);
233
234 rv = await asyncHandler(event, context);
235
236 // We manage lambdas that use Promise.allSettled by capturing the errors of failed promises
237 if (options.captureAllSettledReasons && Array.isArray(rv) && isPromiseAllSettledResult(rv)) {
238 const reasons = getRejectedReasons(rv);
239 reasons.forEach(exception => {
240 captureException(exception, scope => markEventUnhandled(scope, 'auto.function.aws_serverless.promise'));
241 });
242 }
243 } catch (e) {
244 // Errors should already be captured in the AwsLambda instrumentation's error handler,
245 // we capture them here just to be safe. Double captures are deduplicated by the SDK.
246 captureException(e, scope => markEventUnhandled(scope, 'auto.function.aws_serverless.handler'));
247 throw e;
248 } finally {
249 clearTimeout(timeoutWarningTimer);
250 await flush(options.flushTimeout).catch(e => {
251 DEBUG_BUILD && debug.error(e);
252 });
253 }
254 return rv;
255 }
256
257 return withScope(async () => {
258 return processResult();

Callers 1

wrapHandlerFunction · 0.85

Calls 10

captureExceptionFunction · 0.90
markEventUnhandledFunction · 0.90
flushFunction · 0.90
getRejectedReasonsFunction · 0.85
forEachMethod · 0.65
catchMethod · 0.65
errorMethod · 0.65
getCurrentScopeFunction · 0.50

Tested by

no test coverage detected