Unwrap is fine in examples but what do real programs do

Back to list2025-03-21
You

unwrap is fine in examples but what do real programs do?

ChatGPT

Propagate with ? and define one error type per crate boundary. thiserror for libraries, anyhow for applications is the common split: libraries need callers to match on variants, applications mostly need context and a good message.

You

Any downside worth knowing before I commit?

ChatGPT

It commits you to a format that is tedious to migrate away from later. The first weeks also look worse than doing nothing, which is when most people abandon it.