Catch panic message

⚓ Rust    📅 2025-11-06    👤 surdeus    👁️ 6      

surdeus

Info

This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Catch panic message

Hi,

I found how to catch a potential panic when launching some function with :

 let potential_panics_return = tokio::spawn(async move { my_fn().await });

So I can continue my program and it is great.

But same if I catch the panic, a print of the panic appears in my console... And I would like to catch the message printed to in order to not print it now.

Do you know if this action is possible and how ?

1 post - 1 participant

Read full topic

🏷️ Rust_feed