mirror of
https://github.com/rkt/rkt.git
synced 2026-03-13 09:40:21 +08:00
Up to now errors in rkt have been a concatenated string. This often ended with the user being presented with a very long, hard to decipher error message. Furthermore, sometimes the message was prefixed with the name of the command, sometimes not. In essencce, errors messages were inconsistent and confusing. This patch introduces structured error messages using the errwrap package. The goal is to have errors be useful & consistant, and have a single location (common/errors.go) where we can modify the error output. Errors are stored as an inner and outer errors. We do this by nesting errors using errwrap.Wrap. With this structure we have much more control over how we can display errors.