amazon-archives / aws-serverlessrepo-python

A Python library with convenience helpers for working with the AWS Serverless Application Repository.
Apache License 2.0
23 stars 14 forks source link

Better BadRequestException for Non Support Resources #26

Open jfuss opened 5 years ago

jfuss commented 5 years ago

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.

gruebel commented 5 years ago

Is there actually a reason, why not all resources are supported?