News for hackers. Stuff that matters.
Re:Effective Rust by ramranch on Thursday June 15, 2023 @02:17PM (#36344501)
But any standard web framework already would use a panic handler to turn a panic within application code to a 5xx error.
Re:Effective Rust by phamilton on Thursday June 15, 2023 @05:11PM (#36346557)
Here's a discussion on actix-web and panic handlers: https://github.com/actix/actix-web/issues/1501

Some technical limits, a lot of cultural opposition. While it is possible to have a panic handler, it's generally viewed as a bad idea. Not everything is UnwindSafe, there are limits to how much a panic handler can do, concerns about memory leaks.

Again, the caller can turn it into a panic easily enough if that's what they want. leave the decision in their hands.