You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the spawn_and_log_error function from the a-chat example. Unfortunately, this function is not able to capture panics in the spawned tasked. The async-std book mentions that catching panics in the spawned task and reacting with custom behavior is possible. If using spawn_and_log_error is the wrong approach to achieve that, could someone point me in the right direction?
fn spawn_and_log_error<F>(fut: F) -> task::JoinHandle<()>
where
F: Future<Output = Result<()>> + Send + 'static,
{
task::spawn(async move {
if let Err(e) = fut.await {
eprintln!("{}", e)
}
})
}
The text was updated successfully, but these errors were encountered:
I am using the
spawn_and_log_error
function from thea-chat
example. Unfortunately, this function is not able to capture panics in the spawned tasked. Theasync-std
book mentions that catching panics in the spawned task and reacting with custom behavior is possible. If usingspawn_and_log_error
is the wrong approach to achieve that, could someone point me in the right direction?The text was updated successfully, but these errors were encountered: