-
-
Notifications
You must be signed in to change notification settings - Fork 494
Closed
Labels
Bug 🐛This is something that is not working as expectedThis is something that is not working as expectedGood First IssueThis is good for newcomers to take onThis is good for newcomers to take on
Description
Description
Using the below code to define a custom exception does not let the extra field be returned in responses where the error is raised:
class InvalidApiKeyError(NotAuthorizedException):
detail = "Invalid API key"
extra = "The API key you provided is invalid, incorrect, expired, has been revoked, or your account is overdue."
The below code doesn't work either:
class InvalidApiKeyError(NotAuthorizedException):
detail = "Invalid API key"
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.extra = "The API key you provided is invalid, incorrect, expired, has been revoked, or your account is overdue."
URL to code causing the issue
No response
MCVE
# Your MCVE code hereSteps to reproduce
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See errorScreenshots
""Logs
Litestar Version
2.14.0
Platform
- Linux
- Mac
- Windows
- Other (Please specify in the description above)
Metadata
Metadata
Assignees
Labels
Bug 🐛This is something that is not working as expectedThis is something that is not working as expectedGood First IssueThis is good for newcomers to take onThis is good for newcomers to take on