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

fix: improves panic messages when there is no reactor/timer #1789

Conversation

EverlastingBugstopper
Copy link
Contributor

I want to preface this by saying I'm not entirely sure if these error messages are exactly accurate but I wanted to take a crack at it.


Motivation

Providing a more actionable error message when tokio expects to be within a runtime. Fixes #1713

Solution

New error messages:

When there is no timer:

The timer is shutdown, you must execute from within the tokio runtime

When there is no reactor:

There is no reactor, you must execute from within the tokio runtime

I'm not in love with the "you must execute from within the tokio runtime", not sure what the best wording there is, would love some pointers :)

@carllerche
Copy link
Member

Thanks for getting this going. Unfortunately, the code has changed significantly since the PR was open.

What about something like:

"called from outside of the Tokio runtime or from a runtime that has I/O disabled."

@LucioFranco
Copy link
Member

I think we'd love to have this but the code has changed a lot. I am going to close this but we should open a new one against the current version of the code base :)

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.

Improve panic messages when runtime is not running
3 participants