1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

lambda - more limited exception trap when doing get_function for better errors (#28918)

This commit is contained in:
mikedlr 2017-09-01 14:25:54 +01:00 committed by Sloane Hertel
parent ae6d27fa29
commit 506a30cf3e

View file

@ -238,8 +238,13 @@ def get_current_function(connection, function_name, qualifier=None):
if qualifier is not None:
return connection.get_function(FunctionName=function_name, Qualifier=qualifier)
return connection.get_function(FunctionName=function_name)
except ClientError:
except ClientError as e:
try:
if e.response['Error']['Code'] == 'ResourceNotFoundException':
return None
except (KeyError, AttributeError):
pass
raise e
def sha256sum(filename):