Skip to content

Commit

Permalink
runtime: update panic messages to include version (#3461)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn authored Jan 28, 2021
1 parent 1717248 commit 6b1f9f4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tokio/src/io/driver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ cfg_rt! {
/// flag is not enabled.
pub(super) fn current() -> Self {
crate::runtime::context::io_handle()
.expect("there is no reactor running, must be called from the context of Tokio runtime")
.expect("there is no reactor running, must be called from the context of a Tokio 0.3.x runtime")
}
}
}
Expand All @@ -274,7 +274,7 @@ cfg_not_rt! {
/// This function panics if there is no current reactor set, or if the `rt`
/// feature flag is not enabled.
pub(super) fn current() -> Self {
panic!("there is no reactor running, must be called from the context of Tokio runtime with `rt` enabled.")
panic!("there is no reactor running, must be called from the context of a Tokio 0.3.x runtime with `rt` enabled.")
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions tokio/src/runtime/blocking/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
{
let rt = context::current().expect("not currently running on the Tokio runtime.");
let rt = context::current().expect("not currently running on a Tokio 0.3.x runtime.");
rt.spawn_blocking(func)
}

Expand All @@ -91,7 +91,7 @@ where
F: FnOnce() -> R + Send + 'static,
R: Send + 'static,
{
let rt = context::current().expect("not currently running on the Tokio runtime.");
let rt = context::current().expect("not currently running on a Tokio 0.3.x runtime.");

let (task, _handle) = task::joinable(BlockingTask::new(func));
rt.blocking_spawner.spawn(task, &rt)
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/runtime/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Handle {
/// # }
/// ```
pub fn current() -> Self {
context::current().expect("not currently running on the Tokio runtime.")
context::current().expect("not currently running on a Tokio 0.3.x runtime.")
}

/// Returns a Handle view over the currently running Runtime
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/task/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ cfg_rt! {
T::Output: Send + 'static,
{
let spawn_handle = runtime::context::spawn_handle()
.expect("must be called from the context of Tokio runtime configured with either `basic_scheduler` or `threaded_scheduler`");
.expect("must be called from the context of a Tokio 0.3.x runtime configured with either `basic_scheduler` or `threaded_scheduler`");
let task = crate::util::trace::task(task, "task");
spawn_handle.spawn(task)
}
Expand Down
4 changes: 2 additions & 2 deletions tokio/src/time/driver/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ cfg_rt! {
/// panicking.
pub(crate) fn current() -> Self {
crate::runtime::context::time_handle()
.expect("there is no timer running, must be called from the context of Tokio runtime")
.expect("there is no timer running, must be called from the context of a Tokio 0.3.x runtime")
}
}
}
Expand All @@ -71,7 +71,7 @@ cfg_not_rt! {
/// lazy, and so outside executed inside the runtime successfuly without
/// panicking.
pub(crate) fn current() -> Self {
panic!("there is no timer running, must be called from the context of Tokio runtime or \
panic!("there is no timer running, must be called from the context of a Tokio 0.3.x runtime or \
`rt` is not enabled")
}
}
Expand Down

0 comments on commit 6b1f9f4

Please sign in to comment.