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

pull/28905/merge
mikedlr 7 years ago committed by Sloane Hertel
parent ae6d27fa29
commit 506a30cf3e

@ -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:
return None
except ClientError as e:
try:
if e.response['Error']['Code'] == 'ResourceNotFoundException':
return None
except (KeyError, AttributeError):
pass
raise e
def sha256sum(filename):

Loading…
Cancel
Save