mirror of
https://github.com/projecthorus/sondehub-infra.git
synced 2024-12-19 05:07:55 +00:00
add some decent error messages
This commit is contained in:
parent
090bc92edb
commit
702e3bb240
@ -326,7 +326,12 @@ def upload(event, context):
|
||||
post(to_sns)
|
||||
return errors
|
||||
def lambda_handler(event, context):
|
||||
errors = upload(event, context)
|
||||
try:
|
||||
errors = upload(event, context)
|
||||
except zlib.error:
|
||||
return {"statusCode": 400, "body": "Could not decompress"}
|
||||
except json.decoder.JSONDecodeError:
|
||||
return {"statusCode": 400, "body": "Not valid json"}
|
||||
error_message = {
|
||||
"message": "some or all payloads could not be processed",
|
||||
"errors": errors
|
||||
|
Loading…
Reference in New Issue
Block a user