Currently the sysand crate is littered with bail! and anyhow! macros used to generate ad hoc errors in place. It would be nice to try to centralize these in the CliError enum, partly to reduce duplication of error messages and partly to get a better overview of the errors originating in the CLI.
Note that bail! is still useful for simplifying the control flow of error handling but it could preferably be bail!(CliError::<...>) instead of bail!("<ad hoc message>").
Currently the
sysandcrate is littered withbail!andanyhow!macros used to generate ad hoc errors in place. It would be nice to try to centralize these in theCliErrorenum, partly to reduce duplication of error messages and partly to get a better overview of the errors originating in the CLI.Note that
bail!is still useful for simplifying the control flow of error handling but it could preferably bebail!(CliError::<...>)instead ofbail!("<ad hoc message>").