Replace 'Thread already finished' error with common `Error::CoroutineInactive`
This commit is contained in:
parent
64346ce56c
commit
585c0a25d8
|
@ -10,7 +10,6 @@ use crate::value::{FromLuaMulti, MultiValue, ToLuaMulti};
|
||||||
#[cfg(feature = "async")]
|
#[cfg(feature = "async")]
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
error::ExternalError,
|
|
||||||
lua::{ASYNC_POLL_PENDING, WAKER_REGISTRY_KEY},
|
lua::{ASYNC_POLL_PENDING, WAKER_REGISTRY_KEY},
|
||||||
util::get_gc_userdata,
|
util::get_gc_userdata,
|
||||||
value::Value,
|
value::Value,
|
||||||
|
@ -277,7 +276,7 @@ where
|
||||||
|
|
||||||
match self.thread.status() {
|
match self.thread.status() {
|
||||||
ThreadStatus::Resumable => {}
|
ThreadStatus::Resumable => {}
|
||||||
_ => return Poll::Ready(Err("Thread already finished".to_lua_err())),
|
_ => return Poll::Ready(Err(Error::CoroutineInactive)),
|
||||||
};
|
};
|
||||||
|
|
||||||
let _wg = WakerGuard::new(lua.state, cx.waker().clone());
|
let _wg = WakerGuard::new(lua.state, cx.waker().clone());
|
||||||
|
|
Loading…
Reference in New Issue