Catching bugs from Rust for bug reporting

I've been working on a game, and I was wondering if it was possible to catch a bug for a bug reporting. I see the point of not escaping from panics, but then a user would have to start it from the terminal (which no one except linux fans and rust developers would do) to catch and report the error. Is it possible to have a wrapper program that runs it?

2 Likes

The APIs in std::panic may be what you're looking for.

1 Like

You can catch panics within the same process. There are still cases that kill the process, like out of memory or panic during panic.

Thank you!

You may also be looking for the human-panic crate. This essentially overrides the function triggered whenever there's a panic and gives it a much more friendly message, generates a crash report, and prints out links to wherever you want people to upload them.

https://github.com/yoshuawuyts/human-panic

3 Likes