Skip to content

fix(parameters): make GetSecretError inherit from GetParameterError - #8613

Closed
benzanmontage-hue wants to merge 1 commit into
aws-powertools:developfrom
benzanmontage-hue:fix/get-secret-error-inheritance
Closed

benzanmontage-hue wants to merge 1 commit into
aws-powertools:developfrom
benzanmontage-hue:fix/get-secret-error-inheritance

Conversation

@benzanmontage-hue

Copy link
Copy Markdown

Description

GetSecretError subclasses Exception directly, but the docstrings of
get_secrets_by_name and SecretsProvider.get_multiple document that they
raise GetParameterError. As a result, an except GetParameterError around a
batch secret call silently misses the failure.

Changes

  • Make GetSecretError inherit from GetParameterError in exceptions.py.
  • Export GetSecretError from aws_lambda_powertools.utilities.parameters.
  • Add a regression test asserting the inheritance relationship.

Verification

from aws_lambda_powertools.utilities.parameters import GetParameterError, GetSecretError
print(issubclass(GetSecretError, GetParameterError))  # True

Fixes #8595

@benzanmontage-hue
benzanmontage-hue requested a review from a team as a code owner October 18, 2026 15:45
@powertools-for-aws-oss-automation

Copy link
Copy Markdown

No acknowledgement section found. Please make sure you used the template to open a PR and didn't remove the acknowledgment section. Check the template at .github/PULL_REQUEST_TEMPLATE.md#acknowledgment

@boring-cyborg

boring-cyborg Bot commented Oct 18, 2026

Copy link
Copy Markdown

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 18, 2026
@boring-cyborg boring-cyborg Bot added the tests label Oct 18, 2026
@sonarqubecloud

Copy link
Copy Markdown

@benzanmontage-hue
benzanmontage-hue deleted the fix/get-secret-error-inheritance branch October 18, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: GetSecretError does not inherit from GetParameterError as the docstrings say

1 participant