From 6640f68994360f75fa5ce5a49d3519e5e63bbcee Mon Sep 17 00:00:00 2001 From: Tony Meyer Date: Wed, 29 May 2024 14:07:18 +1200 Subject: [PATCH] docs: clarify that SecretNotFound may be raised for permission errors (#1231) As noticed in #1229, `get_secret()` may raise `SecretNotFoundError` if the secret does exist but the caller does not have permission to view it, so make this explicit in the documentation. --- ops/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ops/model.py b/ops/model.py index 3275b4563..d87b022dd 100644 --- a/ops/model.py +++ b/ops/model.py @@ -274,7 +274,8 @@ def get_secret(self, *, id: Optional[str] = None, label: Optional[str] = None) - label: Secret label if fetching by label (or updating it). Raises: - SecretNotFoundError: If a secret with this ID or label doesn't exist. + SecretNotFoundError: If a secret with this ID or label doesn't exist, + or the caller does not have permission to view it. """ if not (id or label): raise TypeError('Must provide an id or label, or both')