-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix overly broad exception conversion in
LambdaFunction.invoke
The intent of the `try`/`except` statement is to catch accesses to missing members of the `data` dictionary, but due to the large amount of code in the `try` block, it may end up catching entirely unrelated `KeyError`s. Those unrelated `KeyError`s should not be converted to `ValidationError`s, since they might not have anything to do with input validation, and the conversion will make it harder to debug these exceptions. An example of these misapplied conversions is a recent bug where a `KeyError` was coming from inside `_get_image` (fixed by f6420eb). To fix this, make sure to only catch `KeyError`s emitted by accesses to `data`.
- Loading branch information
Showing
2 changed files
with
108 additions
and
101 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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