-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
RunError is not a proper Error #491
Comments
👍 would appreciate a PR. |
@vorner would you please provide a MRE to test against? |
I'll probably provide even the PR later this weekend, but here goes the MRE (if MRE is Minimum Reproducer or something like that). extern crate failure;
extern crate tokio;
use failure::Error;
use tokio::prelude::future;
use tokio::runtime::current_thread::Runtime;
fn main() -> Result<(), Error> {
let mut runtime = Runtime::new()?;
// Well, this one would actually spawn some things…
runtime.block_on(future::ok::<_, Error>(()))?;
// This should wait for the rest of the spawned things… but it doesn't work, because RunError
// doesn't implement the Error trait
runtime.run()?;
Ok(())
} I went this way in actual real code, because Both |
The PR has been merged 👍 Thanks again. |
When working with
current_thread::Runtime::run
, I've noticed the returnedRunError
does not implementError
(so it is uncomfortable to handle as an error). It also doesn't seem to have any documentation (it is not a link), no idea why, so it is not clear under which circumstances it can happen.The text was updated successfully, but these errors were encountered: