Improve error handling and logging in event writers#53
Merged
oto-macenauer-absa merged 2 commits intomasterfrom Sep 8, 2025
Merged
Improve error handling and logging in event writers#53oto-macenauer-absa merged 2 commits intomasterfrom
oto-macenauer-absa merged 2 commits intomasterfrom
Conversation
…ig file paths and add error response utility
oto-macenauer
approved these changes
Sep 5, 2025
miroslavpojer
approved these changes
Sep 8, 2025
Contributor
miroslavpojer
left a comment
There was a problem hiding this comment.
- fast read
- review on call
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.
This pull request introduces significant improvements to error handling, writer result aggregation, and test coverage for the event gate Lambda. The main changes include standardizing error responses, updating all writer modules to return detailed error information, aggregating writer results in the main handler, and adding comprehensive unit tests to validate both successful and failure scenarios.
Error Handling and Response Standardization
_error_responsehelper inevent_gate_lambda.pyto standardize all error responses, ensuring consistent structure and error details for authentication, authorization, validation, and internal errors. [1] [2] [3] [4]Writer Modules: Result Reporting
writer_kafka,writer_eventbridge, andwriter_postgresso theirwritefunctions now return a tuple(success: bool, error_message: str|None), allowing the main handler to report which writer failed and why. [1] [2] [3] [4] [5]Main Handler Logic
Configuration and File Path Robustness
Testing and Coverage
tests/test_event_gate_lambda.pythat mocks external dependencies, covers all major GET and POST flows, and verifies correct error and success response structures across a variety of scenarios, including writer failures and internal errors.These changes collectively make the Lambda handler more robust, easier to debug, and better tested, with clear and actionable error reporting throughout.
Related
Closes #52
Release notes: