Skip to content

Commit

Permalink
[mod] [#355 #339] Further improve formatting of errors in Cljs (@DerG…
Browse files Browse the repository at this point in the history
…uteMoritz)

Changes:

  - Print ex-data
  - Print full cause chain
  • Loading branch information
DerGuteMoritz authored and ptaoussanis committed Oct 20, 2022
1 parent 074974f commit 145a7ff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/taoensso/timbre.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -928,11 +928,11 @@
([err ] (stacktrace err nil))
([err opts]
#?(:cljs
;; TODO Better alternatives?
(str
err ; Stringified error incl. (.-message err)
(when-let [s (.-stack err)]
(str enc/system-newline s)))
(let [nl enc/system-newline]
(str
(.-stack err) ; Includes `ex-message`
(when-let [d (ex-data err)] (str nl "ex-data" enc/system-newline " " (pr-str d)))
(when-let [c (ex-cause err)] (str nl "caused by - " (stacktrace c opts)))))

:clj
(let [stacktrace-fonts ; {:stacktrace-fonts nil->{}}
Expand Down

0 comments on commit 145a7ff

Please sign in to comment.