Fix: Error handling, BAD_PDF fallback, and aspect ratio skip#48
Open
Nishit24113 wants to merge 4 commits into
Open
Fix: Error handling, BAD_PDF fallback, and aspect ratio skip#48Nishit24113 wants to merge 4 commits into
Nishit24113 wants to merge 4 commits into
Conversation
…ixes Bug fixes (from PR #46 and #45): - Fix env var passing in RunAltTextGenerationTask: read s3_bucket/s3_key directly from the Map iterator input instead of indexing into the ECS ContainerOverrides array, which GuardDuty sidecar injection can reorder - Fix Bedrock aspect-ratio rejection for form PDFs: skip images exceeding the 20:1 limit and assign "Decorative element" alt text instead of crashing Error handling (no failure can go unreported): - New failure-handler Lambda wired to a Step Functions Catch (States.ALL). On any failure it aggregates per-station detail and writes result/FAILED_<name>.json where the frontend already polls, carrying the reason category and failing chunk/page range - Instrument all 5 stations to write temp/<name>/_errors/<station>.json plus a structured CloudWatch line (station, reason, chunk, page range) - Splitter writes the marker directly (it runs before the state machine) - Fix two silent-success paths: the title Lambda returned 500 dicts and the Java merger returned an error string, both treated as success by Step Functions; they now report and raise so the Catch fires - Add docs/ERROR_HANDLING.md describing the frontend FAILED_ marker contract
Pass the Step Functions execution ARN ($$.Execution.Id) into the failure-handler payload and record it in result/FAILED_<name>.json so support can trace the exact failed execution. Verified: markers now include the execution ARN.
…jects a PDF When Adobe API returns BAD_PDF (400), the container now bypasses autotag/extract, uploads the viewer-preferences PDF as output, and writes an empty image DB so the alt-text step completes cleanly. The user gets a partially-remediated result instead of a silent failure.
Open
3 tasks
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
Files changed
adobe-autotag-container/adobe_autotag_processor.py— BAD_PDF fallback + station error reportingalt-text-generator-container/alt_text_generator.js— aspect ratio validation + skip logicapp.py— failure-handler Lambda, Step Functions Catch, env var fixlambda/failure-handler/main.py— new Lambda (aggregates errors, writes FAILED marker)lambda/pdf-splitter-lambda/main.py— pre-Step-Function failure reportingTest plan