fix: check Lambda execution errors in S3 uploader#97
Open
snoble wants to merge 1 commit intoanomalyco:masterfrom
Open
fix: check Lambda execution errors in S3 uploader#97snoble wants to merge 1 commit intoanomalyco:masterfrom
snoble wants to merge 1 commit intoanomalyco:masterfrom
Conversation
✅ Deploy Preview for sst-docs canceled.
|
The upload function now properly checks the result of lambda.send() and throws an exception when the Lambda execution fails. This ensures that errors from the batch processor are properly propagated up the call stack. The error handling follows the same pattern as script-function/index.ts: - Parses the error payload to extract errorType and errorMessage - Includes the source bucket/key in the error for better debugging - Uses the error.reason pattern consistent with the codebase 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
3936b6a to
7a24232
Compare
Author
|
This fixes an issue that currently exists where a failed s3 uploaded will break your static site deploy. It seems to be a pretty critical bug for sst. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
uploadFilesfunction ins3-uploader.tsto capture and check Lambda invocation resultsFunctionErroris present in the Lambda responseContext
The S3 uploader uses
lambda.send()to invoke batch processors for file uploads. Previously, if the Lambda function failed during execution, the error was not caught becauselambda.send()doesn't throw exceptions for Lambda execution failures - it only throws for client/network errors.This change fixes the issue by:
FunctionErrorpropertyTest plan
🤖 Generated with Claude Code