Return a sensible error when the parameter is not found

This commit is contained in:
William Richard 2019-11-04 15:30:30 -05:00
commit 715ff0f7af
No known key found for this signature in database
GPG key ID: ACD9DA4E735E6D14
2 changed files with 21 additions and 0 deletions

View file

@ -145,6 +145,13 @@ class SimpleSystemManagerResponse(BaseResponse):
result = self.ssm_backend.get_parameter_history(name, with_decryption)
if result is None:
error = {
"__type": "ParameterNotFound",
"message": "Parameter {0} not found.".format(name),
}
return json.dumps(error), dict(status=400)
response = {"Parameters": []}
for parameter_version in result:
param_data = parameter_version.describe_response_object(