2 ms·
The difference is, unwrap will stick out like a sore thumb, and it’s opt-in. You explicitly tell "this may panic". As for error handling, this kind of enrichme
by tuetuopay 4mo ago
The difference is, unwrap will stick out like a sore thumb, and it’s opt-in. You explicitly tell "this may panic".
As for error handling, this kind of enrichment is usually left to the caller (that is, the end application), with error libraries like anyhow where you can add arbitrary string contexts to an error. You would end up writing `Config::load(path).with_context(|| format!("Failed to load configuration file {path}"))?`.
- seabrookmx 4mo agoWhile I agree it's better than the golang alternative, it's definitely still a footgun. See Cloudflare's Nov 2025 outage.