Skip to content

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

Open

Description

@leandrodamascena

Expected Behaviour

get_secrets_by_name and SecretsProvider.get_multiple raise an exception that except GetParameterError catches, as their docstrings state ("Raises GetParameterError"). get_secret already raises GetParameterError.

Current Behaviour

GetSecretError (exceptions.py:7) subclasses Exception directly, so except GetParameterError around a batch call silently misses it. It is also not exported from aws_lambda_powertools.utilities.parameters.

Code snippet

from aws_lambda_powertools.utilities.parameters.exceptions import GetParameterError
from aws_lambda_powertools.utilities.parameters.secrets import GetSecretError

print(issubclass(GetSecretError, GetParameterError))  # False

Possible Solution

class GetSecretError(GetParameterError) and export it from the package __init__.

Steps to Reproduce

Run the snippet above (it uses botocore.stub.Stubber, no AWS access needed).

Powertools for AWS Lambda (Python) version

latest

AWS Lambda function runtime

3.13

Packaging format used

PyPi

Debugging logs

Warning

This issue is ready to be picked up, by humans or by agents. If you want it, comment here first so we can assign it to you, and please take only one or two issues at a time so others can join in too. The reproduction above runs locally without AWS access. Thanks!

Activity

  1. MrForward commented on Oct 18, 2026

    @MrForward

    I'd like to take this one. I'll make GetSecretError subclass GetParameterError and export it from aws_lambda_powertools.utilities.parameters, with a regression test, and open a PR. I use AI tooling to assist; the change is reviewed and tested by me. This is the only issue in this repo I'm claiming right now.

  2. Tanmay-Ts commented on Oct 18, 2026

    @Tanmay-Ts

    Hi @leandrodamascena, I'd like to take this one. Plan: make GetSecretError subclass GetParameterError, export it from aws_lambda_powertools.utilities.parameters, and add a regression test. I have it ready locally with the parameters test suite passing.

  3. leandrodamascena commented on Oct 18, 2026

    @leandrodamascena
    ContributorAuthor

    Hey @MrForward pls go ahead.

  4. added this to the 3.39.0 milestone on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomersparametersParameters utilitytriagePending triage from maintainers

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions