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

Function processStreamingResult

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

Source from the content-addressed store, hash-verified

277 timeoutWarningTimer = setupTimeoutWarning(context, options);
278
279 async function processStreamingResult(): Promise<TResult> {
280 const scope = getCurrentScope();
281
282 try {
283 enhanceScopeWithEnvironmentData(scope, context, startTime);
284
285 responseStream.on('error', error => {
286 captureException(error, scope => markEventUnhandled(scope, 'auto.function.aws_serverless.stream'));
287 });
288
289 return await handler(event, responseStream, context);
290 } catch (e) {
291 // Errors should already be captured in the AwsLambda instrumentation's error handler,
292 // we capture them here just to be safe. Double captures are deduplicated by the SDK.
293 captureException(e, scope => markEventUnhandled(scope, 'auto.function.aws_serverless.handler'));
294 throw e;
295 } finally {
296 if (timeoutWarningTimer) {
297 clearTimeout(timeoutWarningTimer);
298 }
299 await flush(options.flushTimeout).catch(e => {
300 DEBUG_BUILD && debug.error(e);
301 });
302 }
303 }
304
305 return withScope(() => processStreamingResult());
306 };

Callers 1

wrappedHandlerFunction · 0.85

Calls 9

captureExceptionFunction · 0.90
markEventUnhandledFunction · 0.90
flushFunction · 0.90
onMethod · 0.65
catchMethod · 0.65
errorMethod · 0.65
getCurrentScopeFunction · 0.50
handlerFunction · 0.50

Tested by

no test coverage detected