I'm not really interested in introducing an error-handling crate like failure or error-chian because I want to understand how the error handling system actually works first. Additionally, I'm not sure how much advantage there is to be gained in using one of these in a relatively simple CLI application.
That being said, I'm also not really sure what the conventional error handling pattern looks like. It seems like using an enum of error variants seems like a good approach. Should these enum variants accept a payload of some information on the error, and if so should this payload be its own struct?
Basically determine a slim but viable error handling pattern for the project, without adding any additional purpose-specific crates.
I'm not really interested in introducing an error-handling crate like
failure
orerror-chian
because I want to understand how the error handling system actually works first. Additionally, I'm not sure how much advantage there is to be gained in using one of these in a relatively simple CLI application.That being said, I'm also not really sure what the conventional error handling pattern looks like. It seems like using an enum of error variants seems like a good approach. Should these enum variants accept a payload of some information on the error, and if so should this payload be its own struct?
Basically determine a slim but viable error handling pattern for the project, without adding any additional purpose-specific crates.