improve error message

This commit is contained in:
jem 2019-05-24 13:31:12 +02:00
parent dfb35e06f0
commit 20ad5b2394
2 changed files with 4 additions and 3 deletions

View file

@ -42,5 +42,6 @@
(try (try
(read-data (io/resource file-path)) (read-data (io/resource file-path))
(catch IllegalArgumentException e (catch IllegalArgumentException e
(throw (ex-info "unable to load test spec" {:cause e (throw (ex-info (str "Could not find test spec on " file-path)
:file-path file-prefix})))))) {:cause e
:file-path file-prefix}))))))

View file

@ -36,5 +36,5 @@
(sut/load-test-data (sut/data-file-prefix ::test-it))))) (sut/load-test-data (sut/data-file-prefix ::test-it)))))
(deftest should-throw-exception (deftest should-throw-exception
(is (thrown? Exception (is (thrown? RuntimeException
(sut/load-test-data (sut/data-file-prefix ::not-existing))))) (sut/load-test-data (sut/data-file-prefix ::not-existing)))))