Permalink
Browse files

Stop using wrapped exceptions

Maybe this was for the exception fun with clojure 1.3? Otherwise,
there doesn't appear to be any reason for it.
  • Loading branch information...
1 parent 7200175 commit b3579b15a707dc5ca382ec6249dd504c49f1e50a @trptcolin trptcolin committed Mar 3, 2013
Showing with 8 additions and 12 deletions.
  1. +2 −2 project.clj
  2. +5 −8 src/koan_engine/koans.clj
  3. +1 −2 src/koan_engine/util.clj
View
@@ -1,5 +1,5 @@
-(defproject koan-engine "0.1.3"
+(defproject koan-engine "0.2.0"
:description "Koan Engine for Clojure projects."
- :dependencies [[org.clojure/clojure "1.2.1"]
+ :dependencies [[org.clojure/clojure "1.4.0"]
[fresh "1.0.2"]
[jline "0.9.94" :exclusions [junit]]])
@@ -24,16 +24,13 @@
(defn tests-pass? [dojo-path file-path]
(u/with-dojo [dojo-path]
(print "Considering" (str file-path "..."))
+ (println)
(flush)
(try (load-file file-path)
- (do (println) true)
- (catch Exception e
- (println)
- (let [actual-error (or (.getCause e) e)
- message (or (.getMessage actual-error)
- (.toString actual-error))
- ; TODO: use ex-info or something to clean this up, once we're
- ; upgraded to clojure 1.4+
+ true
+ (catch Throwable e
+ (let [message (or (.getMessage e) (.toString e))
+ ; TODO: use ex-info or something to clean this up
line (when-let [groups (first (re-seq #"^\[LINE (\d+)\] "
message))]
(last groups))]
@@ -37,8 +37,7 @@
(catch Throwable e#
(throw (Exception. (str ~(when-let [line (:line (meta x))]
(str "[LINE " line "] "))
- '~message "\n" '~x)
- e#))))))
+ '~message "\n" '~x)))))))
(defn read-project []
(let [rdr (clojure.lang.LineNumberingPushbackReader.

0 comments on commit b3579b1

Please sign in to comment.