Better error messages for the namespace argument
Work around when the first arg is -1 When seemingly valid arguments are given for non existent classes, return a meaningful error message.
This commit is contained in:
parent
9d93cdd19e
commit
fff3757d46
1 changed files with 3 additions and 1 deletions
|
@ -6,6 +6,8 @@
|
|||
(clojure.lang Reflector)))
|
||||
|
||||
(defn- normalize-main [given]
|
||||
(when-not (symbol? (read-string given))
|
||||
(main/abort "Option -m requires a valid namespace argument."))
|
||||
(if (namespace (symbol given))
|
||||
(symbol given)
|
||||
(symbol (name given) "-main")))
|
||||
|
@ -48,7 +50,7 @@
|
|||
[:done (v# ~@args)]
|
||||
[:not-found]))
|
||||
(catch FileNotFoundException e#
|
||||
[:threw e#]))
|
||||
~(main/abort (format "Can't find '%s' as .class or .clj, please check the spelling" given))))
|
||||
|
||||
;; If we didn't succeed above, check if a class exists for
|
||||
;; the given name
|
||||
|
|
Loading…
Reference in a new issue