aws / aws/aws-secretsmanager-caching-python
Don't wrap ResourceNotFoundException
- Dominant language
- Python
- Stars
- 146
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
If the secret is not on AWS Secrets Manager the client will throw a `ResourceNotFoundException` that will be wrapped in [`SecretCacheObject.__refresh`](https://github.com/aws/aws-secretsmanager-caching-python/blob/8b3ed311982096d6cb6a99ab33299ade3c9811b3/src/aws_secretsmanager_caching/cache/items.py#L97)
I think to **wrap `ResourceNotFoundException` is not good practice**: because after the client application has no way to understand that something is wrong in the configuration of Aws SM, and if you have a hook it will be triggered anyway even if an exception occurred and the value is None.
[the implementation of `SecretCacheHook` will receive `cached_obj = None` in the get method]
Contributor guide
Assessment
This issue has not been assessed yet.