-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add handling for backend error #75
base: master
Are you sure you want to change the base?
Conversation
@abersheeran Can I get a review for this PR? Thanks |
tests/test_core.py
Outdated
assert response.text == "custom 503 page" | ||
|
||
|
||
def yourself_503(retry_after: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type hint is incorrect.
Please update |
Updated to the best of my understanding. Please let me know if any additional information needs to be added. |
Can the code be modified so that it passes CI tests? |
Changes
exception
folder to store all the custom exception classescore.py
to catchBaseBackendException
on_backend_error
toRateLimitMiddleware
, defaults to_on_backend_error
and can be modified by enduser by passing their custom functionRedisBackend
to catch ConnectionError raised by redis and raise custom exception instead_on_backend_error
function.