clients: cbc_proxy handles lambda invoke response

Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
This commit is contained in:
Toby Lorne
2020-10-20 15:18:11 +01:00
parent 73507b3abc
commit 75de4abd47
2 changed files with 12 additions and 2 deletions

View File

@@ -52,12 +52,17 @@ class CBCProxyClient:
'description': description,
}), encoding='utf8')
self._ld_client.invoke(
result = self._ld_client.invoke(
FunctionName='bt-ee-1-proxy',
InvocationType='RequestResponse',
Payload=payload_bytes,
)
pass
if result['StatusCode'] > 299:
raise Exception('Could not invoke lambda')
if 'FunctionError' in result:
raise Exception('Function exited with unhandled exception')
# We have not implementated updating a broadcast
def update_and_send_broadcast(