Skip to content

Commit

Permalink
docs: clarify that SecretNotFound may be raised for permission errors (
Browse files Browse the repository at this point in the history
…#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.
  • Loading branch information
tonyandrewmeyer authored May 29, 2024
1 parent c4abc6a commit 6640f68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ops/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 6640f68

Please sign in to comment.