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

[SFU] Handle ConnectionError exception instead of MaxRetryError #664

Merged
merged 3 commits into from
May 19, 2024

Conversation

Injabie3
Copy link
Member

@Injabie3 Injabie3 commented May 6, 2024

When we introduced retries in #591, we expected to handle the MaxRetryError exception. Instead, what appears to happen is the MaxRetryError exception block isn't hit, and instead, we get a chain of Exceptions that results in the underlying Exception being raised, which is a ConnectionError.

As such, this commit changes the MaxRetryError block to a ConnectionError block, thus returning a more descriptive message to the end user. An early return is also added to avoid a UnboundLocalError when trying to use fetchedData after the Exception was handled.

This addresses #663.

When we introduced retries in SFUAnime#591, we expected to handle
the MaxRetryError exception. Instead, what appears to happen is the
MaxRetryError exception block isn't hit, and instead, we get a chain
of Exceptions that results in the underlying Exception being raised,
which is a ConnectionError.

As such, this commit changes the MaxRetryError block to a
ConnectionError block, thus returning a more descriptive message to the
end user. An early return is also added to avoid a UnboundLocalError
when trying to use fetchedData after the Exception was handled.

This addresses SFUAnime#663.
Copy link
Member

@quachtridat quachtridat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Just a small nit.

cogs/sfu/roads.py Outdated Show resolved Hide resolved
Co-authored-by: Dat Quach <quachtridat@yahoo.com.vn>
@quachtridat quachtridat self-assigned this May 18, 2024
Copy link
Member

@quachtridat quachtridat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

cogs/sfu/roads.py Outdated Show resolved Hide resolved
Co-authored-by: Dat Quach <quachtridat@yahoo.com.vn>
@Injabie3 Injabie3 merged commit 685602a into SFUAnime:V3/testing May 19, 2024
13 checks passed
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