Error Handling in Large Systems: The Debate Around Rust's .unwrap() Method
By
thundergolfer
Pure flour-power. Hearty enough to carry you through lunch.
Summary
The article discusses the debate around error handling in large systems, sparked by Cloudflare's November 18 outage postmortem that mentioned a single line of Rust code: '.unwrap()'. The author explains that in Rust, 'unwrap()' either returns a successful result or crashes the program, similar to an assert statement. The piece argues that most discussions about whether asserts are good in production miss the point, suggesting that the real issue is about having more options and choices in error handling strategies rather than prescribing one-size-fits-all solutions.
Key quotes
· 5 pulledCloudflare's deep postmortem for their November 18 outage triggered a ton of online chatter about error handling, caused by a single line in the postmortem: .unwrap()
If you're not familiar with Rust, you need to know about Result, a kind of struct that can contain either a successful result, or an error. unwrap says basically 'return the successful results if there is one, otherwise crash the program'
You can think of it like an assert.
There's a ton of debate about whether asserts are good in production, but most are missing the point.
More options means more choices.
You might also wanna read
A Practical Guide to Scaling Web Systems from Zero to 10+ Million Users
This article provides a practical guide to scaling web systems from zero to over 10 million users, based on the author's experience at big t
Three Years In: A Senior Engineer's Reflection on AI's Impact on the Software Development Role
A senior engineer reflects on the long-term sustainability of AI tools in software development, three years into deep organizational adoptio
Three Years In: A Senior Engineer's Reflection on AI's Impact on the Software Development Role
A senior engineer reflects on the long-term sustainability of AI tools in software development, three years into deep organizational adoptio
Bijou64: A variable-length integer encoding that's both correct and accidentally fast
This article describes the development of bijou64, a variable-length integer (varint) encoding created for the Subduction CRDT sync protocol
Bijou64: A variable-length integer encoding that's both correct and accidentally fast
This article describes the development of bijou64, a variable-length integer (varint) encoding created for the Subduction CRDT sync protocol
Domain Expertise, Not Code, Is the True Competitive Advantage in Software
The article argues that true competitive advantage ("moat") in software has always been domain expertise—deep understanding of the business
