Closed awvwgk closed 2 years ago
Staged for the next release. As far as I can tell errors in the input besides the method should result in an exception throw and an appropriate return status.
The current error handling with throwing exceptions seems a bit unclean, especially since it causes an ABRT signal.
❯ sparrow --version
terminate called after throwing an instance of 'boost::wrapexcept<boost::program_options::unknown_option>'
what(): unrecognised option '--version'
zsh: abort (core dumped) sparrow --version
Preferable would be to catch the exception and present the error message in a useful way to the user. I would usually consider an uncaught exception in an executable as a bug rather than a wanted way of returning an error to the user.
Release 3.0.1 of Sparrow is out, so this should be fixed.
After finally getting to test Sparrow, I did find that the error reporting is not reliable, especially in case of wrong command-line options the exit status is not non-zero:
It would be preferable to signal failure via a non-zero exit status IMO.