From 4907a97a58419c4ac7288f49fcfae47fe3f86c84 Mon Sep 17 00:00:00 2001 From: JPeer264 Date: Mon, 14 Sep 2026 12:06:44 +0200 Subject: [PATCH] docs(aws-lambda): Fix three snippets that do not run - The ESM verify handler closed with `}));`, one `)` too many, so loading the file threw `SyntaxError: Unexpected token ')'` and produced no span. - The `captureAllSettledReasons` example called `Promise.rejected(...)` twice. There is no such method, so it threw `TypeError: Promise.rejected is not a function` before the wrapper could capture anything. The method is `Promise.reject`. - `Sentry.pgIntegration()` and `Sentry.ioredisIntegration()` are not exported. The package re-exports `postgresIntegration` and `redisIntegration` from `@sentry/node`, so the integrations array threw before `Sentry.init` ran. This is the same defect the Google Cloud Functions guide carries. Refs SDK-1518 Co-Authored-By: Claude Opus 5 --- .../guides/aws-lambda/configuration/lambda-wrapper.mdx | 4 ++-- docs/platforms/javascript/guides/aws-lambda/index.mdx | 2 +- .../tracing/instrumentation/automatic-instrumentation.mdx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/platforms/javascript/guides/aws-lambda/configuration/lambda-wrapper.mdx b/docs/platforms/javascript/guides/aws-lambda/configuration/lambda-wrapper.mdx index 69405173cc771..e22dd3aad68c3 100644 --- a/docs/platforms/javascript/guides/aws-lambda/configuration/lambda-wrapper.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/configuration/lambda-wrapper.mdx @@ -48,8 +48,8 @@ The `captureAllSettledReasons` (default: `false`) option captures all promise re exports.handler = Sentry.wrapHandler( () => { return Promise.allSettled([ - Promise.rejected(new Error("first")), - Promise.rejected(new Error("second")), + Promise.reject(new Error("first")), + Promise.reject(new Error("second")), ]); }, { captureAllSettledReasons: true } diff --git a/docs/platforms/javascript/guides/aws-lambda/index.mdx b/docs/platforms/javascript/guides/aws-lambda/index.mdx index ece7399253ddb..2ca0e488b23af 100644 --- a/docs/platforms/javascript/guides/aws-lambda/index.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/index.mdx @@ -50,7 +50,7 @@ import * as Sentry from "@sentry/aws-serverless"; export const handler = Sentry.wrapHandler(async (event, context) => { throw new Error("This is a test error"); -})); +}); ``` ## Next Steps diff --git a/docs/platforms/javascript/guides/aws-lambda/tracing/instrumentation/automatic-instrumentation.mdx b/docs/platforms/javascript/guides/aws-lambda/tracing/instrumentation/automatic-instrumentation.mdx index 59e8044f6c807..9be93cc7c979c 100644 --- a/docs/platforms/javascript/guides/aws-lambda/tracing/instrumentation/automatic-instrumentation.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/tracing/instrumentation/automatic-instrumentation.mdx @@ -32,11 +32,11 @@ Sentry.init({ integrations: [ Sentry.mysqlIntegration(), Sentry.mysql2Integration(), - Sentry.pgIntegration(), + Sentry.postgresIntegration(), Sentry.graphqlIntegration(), Sentry.mongoIntegration(), Sentry.mongooseIntegration(), - Sentry.ioredisIntegration(), + Sentry.redisIntegration(), ], }); ```