Skip to content

🎥 Make videos programmatically with React

Add diagnostics if lambda fails with unhandled exception

Jonny Burgere25ca620c88c
diff --git a/packages/lambda/src/shared/call-lambda.ts b/packages/lambda/src/shared/call-lambda.ts
index 035e798dbe..14bdef3d8b 100644
--- a/packages/lambda/src/shared/call-lambda.ts
+++ b/packages/lambda/src/shared/call-lambda.ts
@@ -145,7 +145,9 @@ const callLambdaWithoutRetry = async <T extends LambdaRoutines>({
const logs = `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-3600~timeType~'RELATIVE~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40requestId*2c*20*40message*0a*7c*20filter*20*40requestId*20like*20*${res.$metadata.requestId}*22*0a*7c*20sort*20*40timestamp*20asc~source~(~'*2faws*2flambda*2f${functionName}))`;
if (event.InvokeComplete.ErrorCode === 'Unhandled') {
throw new Error(
- `Lambda function ${functionName} failed with an unhandled error. See ${logs} to see the logs of this invocation.`,
+ `Lambda function ${functionName} failed with an unhandled error: ${
+ event.InvokeComplete.ErrorDetails as string
+ } See ${logs} to see the logs of this invocation.`,
);
}