From 1011db63725b207015a25a672e0795a7f5a1b9a3 Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Mon, 23 Jan 2023 19:54:16 -0500 Subject: [PATCH] Silence task.wait error in canceled tasks --- src/lib/utils/task.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/utils/task.rs b/src/lib/utils/task.rs index 5275a59..125b5c0 100644 --- a/src/lib/utils/task.rs +++ b/src/lib/utils/task.rs @@ -1,3 +1,4 @@ +use std::fmt::Debug; use std::sync::Weak; use mlua::prelude::*; @@ -43,6 +44,7 @@ pub async fn run_registered_task( sender .send(match to_run.await { Ok(_) => LuneMessage::Finished, + Err(LuaError::CoroutineInactive) => LuneMessage::Finished, // Task was canceled Err(e) => LuneMessage::LuaError(e), }) .await