root-cause

clojure.repl

  • (root-cause t)
Returns the initial cause of an exception or error by peeling off all of
its wrappers

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/repl.clj:217 top

(defn root-cause
  "Returns the initial cause of an exception or error by peeling off all of
  its wrappers"
  {:added "1.3"}
  [^Throwable t]
  (loop [cause t]
    (if (and (instance? clojure.lang.Compiler$CompilerException cause)
             (not= (.source ^clojure.lang.Compiler$CompilerException cause) "NO_SOURCE_FILE"))
      cause
      (if-let [cause (.getCause cause)]
        (recur cause)
        cause))))
Vars in clojure.repl/root-cause:
Used in 0 other vars

Comments top

No comments for root-cause. Log in to add a comment.