aws / aws/aws-secretsmanager-caching-python

Don't wrap ResourceNotFoundException

Open
#20 2 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.