From 652cc6d29cd3ca34dc333a7463f8c8d3e78e68e5 Mon Sep 17 00:00:00 2001 From: Colin Jones Date: Fri, 23 Sep 2011 14:55:06 -0500 Subject: [PATCH] Fix auto-runner for exceptions without causes or messages, fixes #16 --- src/runner/koans.clj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/runner/koans.clj b/src/runner/koans.clj index fcbdaf8..bc7c514 100644 --- a/src/runner/koans.clj +++ b/src/runner/koans.clj @@ -47,9 +47,10 @@ (println "Problem in" file-path) (println "---------------------") (println "Assertion failed!") - (println (.replaceFirst (.getMessage (.getCause e)) - "^Assert failed: " - "")) + (let [actual-error (or (.getCause e) e) + message (or (.getMessage actual-error) + (.toString actual-error))] + (println (.replaceFirst message "^Assert failed: " ""))) false))) (defn namaste []