-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return code / system.exit() #49
Comments
Urgh! It looks like the JVM uses the exit code for itself and not the application it's running. That was certainly unexpected news! Wdyt @lkitching? Perhaps we could just wrap (try
,,,
(catch Exception e
(log/error e)
(System/exit 1))) 🤔 maybe we need to catch all |
Yes that would be the simplest fix. It might be worth extracting details like this into a protocol representing the execution environment to keep the entry point small but catching the exception in |
Issue #49 - Wrap main in a try/catch block and exit with a non-zero exit code in the event of an exception being thrown. The JVM does not guarantee to set a non-zero code if the program terminates due to an unhandled exception. Add a display-error method for displaying unhandled exceptions based on the :type key of the associated ex-data map if one exists. Refactor the CLI argument parser to raise an exception if the arguments are invalid. Display the usage summary in the handler for invalid CLI exceptions.
Any chance you could return an error code on exception? I'm always surprised that the JVM doesn't do this automatically, but if an unhandled exception is raised, the return code defaults to 0 (success).
The text was updated successfully, but these errors were encountered: