generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 462
Closed
Copy link
Labels
bugSomething isn't workingSomething isn't workingpending-releaseFix or implementation already in dev waiting to be releasedFix or implementation already in dev waiting to be released
Description
Expected Behaviour
The public docs for AppSync exceptions state that UnauthorizedException accepts optional keyword arguments.
Current Behaviour
The implementation forwards those kwargs directly to Exception.__init__, which doesn’t accept keyword arguments, so any caller passing a documented kwarg receives TypeError.
Code snippet
from aws_lambda_powertools.event_handler.events_appsync.exceptions import UnauthorizedException
UnauthorizedException("Access denied", trace_id="abc123")Traceback (most recent call last):
File "/data/src/test.py", line 4, in <module>
UnauthorizedException("Access denied", trace_id="abc123")
File "/home/hdd/miniconda3/envs/py312/lib/python3.12/site-packages/aws_lambda_powertools/event_handler/events_appsync/exceptions.py", line 24, in __init__
super().__init__(message, *args, **kwargs)
TypeError: UnauthorizedException() takes no keyword arguments
Possible Solution
Fix could be either consume/record kwargs inside UnauthorizedException before calling super().__init__, or remove **kwargs from the signature/docs to reflect the real capability.
Steps to Reproduce
Run the repro script.
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.12
Packaging format used
PyPi
Debugging logs
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpending-releaseFix or implementation already in dev waiting to be releasedFix or implementation already in dev waiting to be released
Type
Projects
Status
Coming soon