Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Underlying (and useful) exception details are hidden #10

Closed
morrissimo opened this issue Aug 29, 2017 · 3 comments
Closed

Underlying (and useful) exception details are hidden #10

morrissimo opened this issue Aug 29, 2017 · 3 comments
Assignees
Labels

Comments

@morrissimo
Copy link

This has bitten me numerous times!

All of the following instances catch ClientError from botocore and re-raise a new generic (and remarkably useless by comparison) exception:

  • key_providers.kms._generate_data_key:L213
  • key_providers.kms._encrypt_data_key:L250
  • key_providers.kms._decrypt_data_key:L283

I believe a different approach should be taken here to prevent hiding botocore Client exception details (network connectivity, insufficient permissions, etc).

@mattsb42-aws
Copy link
Member

We intentionally normalize the exceptions raised in order to maintain a consistent API across all master keys. This is important not only for consistency, but also because not all master key implementations will want to expose to the runtime why they failed, just that they did.

In this case, I think it is reasonable to make the underlying exception details available. What we can do is log the original exception details. That maintains the API promise but also gives you the cause of the underlying exception in your debug logs.

@mattsb42-aws mattsb42-aws self-assigned this Aug 29, 2017
@morrissimo
Copy link
Author

Sounds good - thanks for the quick response

@mattsb42-aws
Copy link
Member

This is addressed in #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants