(ex-cause ex)
Returns exception cause (an Error / ExceptionInfo) if ex is an ExceptionInfo. Otherwise returns nil.
(defn ex-cause [ex] (when (instance? ExceptionInfo ex) (.-cause ex)))