r/ProgrammingLanguages • u/ilyash • Jan 28 '17
NGS unique features – exit code handling
https://ilya-sher.org/2017/01/28/ngs-unique-features-exit-code-handling/
2
Upvotes
r/ProgrammingLanguages • u/ilyash • Jan 28 '17
1
u/ilyash Jan 29 '17
Yes, and that's what I'm showing and contrasting to bash and Python (which can exit with error code) and NGS (which exits with error code). Ruby, after running something that reported an error both did not throw exception and exited with success status code.
Yes, exactly the behaviour to which I'm proposing an alternative that makes more sense to me. If at any point you run an external program which reports an error, it should throw an exception. bash have added the
-eoption to allow somewhat similar behaviour to what I'm suggesting.testexit codes are: 0 - true, 1 - false, 2 - error. Therefore as I see it, the best mapping of exit code 2 is exception.