mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
properly log the lambda response correctly
boto returns a `StreamingBody`[1] response rather than a json struct. We're currently just logging things like "Error calling lambda o2-1-proxy with function error <botocore.response.StreamingBody object at 0x7f74cd6e02e8>" which is obviously less than ideal. Also make the tests properly reflect this - annoyingly it appears like we can't use moto to reliably test this interface as the moto `mock_lambda` decorator needs you to be running inside a docker container?? [1] https://botocore.amazonaws.com/v1/documentation/api/latest/reference/response.html#botocore.response.StreamingBody
This commit is contained in:
@@ -147,7 +147,7 @@ class CBCProxyClientBase(ABC):
|
||||
|
||||
elif 'FunctionError' in result:
|
||||
current_app.logger.info(
|
||||
f"Error calling lambda {lambda_name} with function error { result['Payload'] }"
|
||||
f"Error calling lambda {lambda_name} with function error { result['Payload'].read() }"
|
||||
)
|
||||
success = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user