SAM CLI was cut this issue, which outputs a stack trace when Unsupported Resources are within the template that is being published.
I think it makes sense to include some additional error handling within this library that provides a better error that the boto3 error that gets returned. This is similar to wrapping of the Botocore ClientError that this library already wraps.
Proposal
Add a UnsupportedResourcesError in exceptions.py. We can then catch botocore.errorfactory.BadRequestException in this try: except: block and wrap it in the UnsupportedResourcesError with a message of "The template contains unsupported resource types. [XX::XX::XX]", which can be parsed out of the exception.
SAM CLI was cut this issue, which outputs a stack trace when Unsupported Resources are within the template that is being published.
I think it makes sense to include some additional error handling within this library that provides a better error that the boto3 error that gets returned. This is similar to wrapping of the Botocore ClientError that this library already wraps.
Proposal
Add a
UnsupportedResourcesError
inexceptions.py
. We can then catchbotocore.errorfactory.BadRequestException
in thistry: except:
block and wrap it in the UnsupportedResourcesError with a message of "The template contains unsupported resource types. [XX::XX::XX]", which can be parsed out of the exception.