Closed ajtucker closed 3 years ago
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 csv2rdf.main/-main
in something like:
(try
,,,
(catch Exception e
(log/error e)
(System/exit 1)))
:thinking: maybe we need to catch all Throwable
?
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 main
seems fine for now.
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).