Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: exceptions for auth errors 400, 401, 403 #230

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

davidhuser
Copy link
Contributor

related to #229

  • introduce new exceptions including a factory to assign exceptions based on starlette.request type (http or websocket)
  • updated the contributor guide
  • fixed a minor mypy issue preventing pre-commit

@davidhuser
Copy link
Contributor Author

davidhuser commented Feb 11, 2025

failing linting tests in demo_project but these seem unrelated to this PR. How should we proceed?

@davidhuser davidhuser changed the title feat: differentiating between error codes feat: exceptions for auth errors 400, 401, 403 Feb 11, 2025
@JonasKs
Copy link
Member

JonasKs commented Feb 12, 2025

I really like this, thanks!! I have some concerns about backwards compatibility, since I'd prefer not to major bump again 😁 Could we ensure that the old InvalidAuthHttp is a base? So anyone importing it, or catching it, will still catch all exceptions?

Something like this, I think would work?

class InvalidAuth(HTTPException):
    ...

class ForbiddenHttp(InvalidAuth, HTTPException):
    ...

failing linting tests in demo_project but these seem unrelated to this PR. How should we proceed?

Ignore. I'll look into this another time. It won't block merge 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants