[#221] print name of exception
This commit is contained in:
parent
8e24744d35
commit
19767b54a3
2 changed files with 7 additions and 1 deletions
|
|
@ -247,7 +247,9 @@ Everything after that is bound to *command-line-args*."))
|
||||||
(if exit-code [nil exit-code]
|
(if exit-code [nil exit-code]
|
||||||
(do (if verbose?
|
(do (if verbose?
|
||||||
(print-stack-trace e)
|
(print-stack-trace e)
|
||||||
(println (.getMessage e)))
|
(println (str (.. e getClass getName)
|
||||||
|
(when-let [m (.getMessage e)]
|
||||||
|
(str ": " m)) )))
|
||||||
(flush)
|
(flush)
|
||||||
[nil 1])))))
|
[nil 1])))))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@
|
||||||
(is (thrown-with-msg? Exception #"does not exist" (bb nil "foo.clj")))
|
(is (thrown-with-msg? Exception #"does not exist" (bb nil "foo.clj")))
|
||||||
(is (thrown-with-msg? Exception #"does not exist" (bb nil "-help")))))
|
(is (thrown-with-msg? Exception #"does not exist" (bb nil "-help")))))
|
||||||
|
|
||||||
|
(deftest print-error-test
|
||||||
|
(is (thrown-with-msg? Exception #"java.lang.NullPointerException"
|
||||||
|
(bb nil "(subs nil 0 0)"))))
|
||||||
|
|
||||||
(deftest main-test
|
(deftest main-test
|
||||||
(testing "-io behaves as identity"
|
(testing "-io behaves as identity"
|
||||||
(= "foo\nbar\n" (test-utils/bb "foo\nbar\n" "-io" "*input*")))
|
(= "foo\nbar\n" (test-utils/bb "foo\nbar\n" "-io" "*input*")))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue