Skip to content

Commit

Permalink
[fix] [#365] Provide protection against faulty error-fn
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Feb 27, 2023
1 parent 63712c5 commit 39e670a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/taoensso/timbre.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,13 @@
(when-let [err ?err]
(when-let [ef (get output-opts :error-fn default-output-error-fn)]
(when-not (get output-opts :no-stacktrace?) ; Back compatibility
(str enc/system-newline
(ef data)))))))))
(enc/catching
(str enc/system-newline (ef data)) _
(str
enc/system-newline
"[TIMBRE WARNING]: `error-fn` failed, falling back to `pr-str`:"
enc/system-newline
(enc/catching (pr-str err) _ "<pr-str failed>"))))))))))

(defn- default-arg->str-fn [x]
(enc/cond
Expand Down

0 comments on commit 39e670a

Please sign in to comment.