Comment on How One Uncaught Rust Exception Took Out Cloudflare

<- View Parent
sugar_in_your_tea@sh.itjust.works ⁨13⁩ ⁨hours⁩ ago

Yes, it’s not the same since you get a stacktrace (if enabled) and a message, but it’s the closest thing you get in safe rust (outside compiler bugs). I compare it to a segfault because it’s almost as unhandleble.

Basically, you don’t want a panic to crash your program in most cases. If you do, make it explicit (i.e. with expect()). unwrap() tells me the value is absolutely there or the dev is lazy, and I always assume the latter unless there’s an explanation (or it’s obvious from context) otherwise.

source
Sort:hotnewtop