Hacker News new | ask | show | jobs
by Measter 201 days ago
Fun fact: that's what an unwrap does. It panics, which causes the error to be logged and the thread ended.
2 comments

And one of the fun things about how unwrap() does that automatically, is that if you are working with an orchestrator with retry logic, you won't need to (re-re-re-re-re-)write your own for the entire program - the orchestrator will see the error, log its output, and try again in high volume workloads, or move on to the next request - this is incredible and nice to use especially when a failure in one request doesn't need to fail the entire application for all requests.

I shy away from unwrap() in almost all cases (as should anyone!) but if you are running a modular system, then unwrap when placed strategically can be incredibly useful.

I think the commenter meant "return a Result<_>" instead of exit. Your snark is perhaps amusing, but not particularly charitable.