From 4ea3ec15e55cf4c52ced91efdf4f3664937ef43b Mon Sep 17 00:00:00 2001 From: Seb Aebischer Date: Wed, 1 Jul 2026 20:43:11 +0100 Subject: [PATCH 1/2] docs: Include wrap options in v2 migration guide --- docs/migration/v2.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/migration/v2.md b/docs/migration/v2.md index 0107002..3d7feeb 100644 --- a/docs/migration/v2.md +++ b/docs/migration/v2.md @@ -77,6 +77,8 @@ Rather than passing in a config object everywhere you use Lambda Wrapper, you no v2 also drops support for callback-style async. Use promises instead. +Wrap options (the `throwError` parameter) are now passed in as an object. + Finally, there is no longer a `request` parameter provided to your wrapped function. You can get this from `di` if you need it. Instead of this: @@ -104,6 +106,18 @@ export default lambdaWrapper.wrap(async (di) => { }); ``` +If using the `throwError` parameter, this needs to be replaced with the new `handleUncaughtErrors` wrap option. Note that the value should be negated; the new option's name better explains what Lambda Wrapper is doing, and needs the opposite value to select the same behaviour. + +```ts +// v1 +export default lambdaWrapper.wrap(CONFIGURATION, handler, /* throwError */ true); + +// v2 equivalent +export default lambdaWrapper.wrap(CONFIGURATION, handler, { + handleUncaughtErrors: false, +}); +``` + If your project doesn't add any additional services to dependency injection, you can also now use `lambdaWrapper` straight out of the box: ```ts From 0be34a98686cccee44b41638420f5d969ae15218 Mon Sep 17 00:00:00 2001 From: Seb Aebischer Date: Thu, 2 Jul 2026 10:12:53 +0100 Subject: [PATCH 2/2] Correct copy-paste mistakes --- docs/migration/v2.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/migration/v2.md b/docs/migration/v2.md index 3d7feeb..10ee469 100644 --- a/docs/migration/v2.md +++ b/docs/migration/v2.md @@ -110,10 +110,10 @@ If using the `throwError` parameter, this needs to be replaced with the new `han ```ts // v1 -export default lambdaWrapper.wrap(CONFIGURATION, handler, /* throwError */ true); +export default LambdaWrapper(CONFIGURATION, handler, /* throwError */ true); // v2 equivalent -export default lambdaWrapper.wrap(CONFIGURATION, handler, { +export default lambdaWrapper.wrap(handler, { handleUncaughtErrors: false, }); ```