Re:Cloudflare outage on November 18, 2025 post mortem
by wrs on Wednesday November 19, 2025 @12:50AM
(#45976282)
I would say, sure, if you feel the same way about panic calls making to production. In other words, review all of them the same way. Because writing unwrap/expect is exactly the same as writing “if error, panic”.
Re:Cloudflare outage on November 18, 2025 post mortem
by littlestymaar on Wednesday November 19, 2025 @06:53AM
(#45978474)
I don't understand your point: panic! is akin to expect: you think about it consciously, use it explicitly and you write down a panic message explaining its rational.
unwrap isn't like that.
Re:Cloudflare outage on November 18, 2025 post mortem
by wrs on Wednesday November 19, 2025 @12:19PM
(#45982123)
It should be. If you aren’t treating it exactly the same as panic and expect, that’s what I’m calling the “blind spot”. And why should you have to make up a message every time when the backtrace is going to tell you what was wrong?
Re:Cloudflare outage on November 18, 2025 post mortem
by littlestymaar on Wednesday November 19, 2025 @02:10PM
(#45983708)
> And why should you have to make up a message every time when the backtrace is going to tell you what was wrong?
The message isn't really here to be displayed during a crash (since the crash should never happen in the first place), it's here to communicate the invariant in the code, to the developer reading and modifying it later on.
An unwrap should never make it to production IMHO. It's fine while prototyping, but once the project gets closer to production it's necessary to just grep `uncheck` in your code and replace those that can happen with a proper error management and replace those that cannot happen with `expect`, with a clear justification of why they cannot happen unless there's a bug somewhere else.