Hi,
If you are using Lambda Proxy integration, you are responsible for returning a proper response whether its a success or an exception.
You can do so by catching the exception.
def handler(event, context):
try:
return {
'statusCode': 200,
'body': json.dumps({
'hello': 'world'
})
}
except BadRequestError:
return {
'statusCode': 400,
'body': json.dumps({
'error': 'Bad Request Error'
})
}
except:
return {
'statusCode': 500,
'body': json.dumps({
'error': 'Internal Server Error'
})
}
Thanks
Alison