From 73b64954e60161e36b57f54e86858927968ff7fd Mon Sep 17 00:00:00 2001 From: vanten-s Date: Fri, 30 Aug 2024 11:32:50 +0200 Subject: [PATCH] :3 --- src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 629d5b7..fdde245 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,7 @@ use eyre::Result; use mail_parser::MessageParser; use std::{ ffi::{c_char, CStr}, + panic::catch_unwind, sync::Mutex, }; @@ -44,7 +45,7 @@ extern "C" fn message_handler_wrapper(message: *const c_char) { println!("Creating körtid"); let handle = tokio::runtime::Runtime::new().expect("Couldn't skapa the körtid"); println!("Går in i körtid"); - handle.block_on(message_handler(message)).unwrap(); + let _ = catch_unwind(|| handle.block_on(message_handler(message))); } async fn message_handler(message: String) -> Result<()> {