(defn repl-caught
"Default :caught hook for repl"
[e]
(let [ex (repl-exception e)
tr (.getStackTrace ex)
el (when-not (zero? (count tr)) (aget tr 0))]
(binding [*out* *err*]
(println (str (-> ex class .getSimpleName)
" " (.getMessage ex) " "
(when-not (instance? clojure.lang.Compiler$CompilerException ex)
(str " " (if el (stack-element-str el) "[trace missing]"))))))))