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

Raise TimeoutError instead of RuntimeError #1049

Closed
edwardzjl opened this issue Dec 10, 2024 · 2 comments
Closed

Raise TimeoutError instead of RuntimeError #1049

edwardzjl opened this issue Dec 10, 2024 · 2 comments

Comments

@edwardzjl
Copy link

This is more of a question than a bug report.

In

raise RuntimeError(
and
raise RuntimeError("Kernel didn't respond in %d seconds" % timeout)
a RuntimeError is raised when a timeout occurs, rather than a TimeoutError.

However in other places, such as

raise TimeoutError(msg) from e
and
raise TimeoutError(emsg)
, a TimeoutError is raised.

Is it intentional that a RuntimeError is raised during the wait_for_ready stage instead of a TimeoutError?

@minrk
Copy link
Member

minrk commented Dec 10, 2024

I believe the RuntimeError predates the existence of TimeoutError, added in Python 3.3. It does make sense to use TimeoutError, though changing it now would technically be a breaking change, as code that caught this error would no longer catch it.

@edwardzjl
Copy link
Author

Thank you for the clarification! I’ll close this issue now.

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

No branches or pull requests

2 participants