Welcome! Please see the About page for a little more info on how this works.

0 votes
in Tools by

If a FileNotFoundException is thrown while running a program started with clojure -X, then it will print "Namespace could not be loaded " rather than the FileNotFoundException. This differs from -M.

Minimal repro for clojure -X misreporting FileNotFoundException.
https://github.com/phronmophobic/filenotfoundcli

bash-3.2$ clojure -X main/-main
finished loading main
Namespace could not be loaded: main

This behavior differs from -M

bash-3.2$ clojure -M -m main
finished loading main
Execution error (FileNotFoundException) at main/-main (main.clj:4).
null

Full report at:
/var/folders/fk/l27d_8g52450jh4m7_dhqkr00000gn/T/clojure-16350436886037263655.edn

Not a big deal, but came up when working on a command line tool, https://github.com/phronmophobic/membrane.term/issues/5. Basically, the FileNotFoundException would have been a suboptimal (but acceptable) error message for a non existent color scheme file, but the namespace message is misleading.

Version info:

bash-3.2$ clojure --version
Clojure CLI version 1.10.3.986

1 Answer

+2 votes
by
selected by
 
Best answer

Thanks, I've fixed it for the next release.

by
Wow! Thanks!
by
Thanks. I ran into a similar issue just over a week ago and I've been meaning to add an "ask" about it!
...