(defn
exception->display-data
[{:keys
[failed-loading-clj-file
failed-compiling
reader-exception
analysis-exception
display-ex-data
class
file
line
column
message
error-inline],
:as exception}]
(let
[last-message
(cond
(and file line)
(str "Please see line " line " of file " file)
file
(str "Please see " file)
:else
nil)]
{:head
(cond
failed-loading-clj-file
"Couldn't load Clojure file"
analysis-exception
"Could not Analyze"
reader-exception
"Could not Read"
failed-compiling
"Could not Compile"
:else
"Compile Exception"),
:sub-head file,
:messages
(concat
(map
(fn* [p1__18500#] (str "<div>" p1__18500# "</div>"))
(if
message
[(str
(if class (str (escape class) ": ") "")
"<span style=\"font-weight:bold;\">"
(escape message)
"</span>")
(when
display-ex-data
(str
"<pre>"
(utils/pprint-to-string display-ex-data)
"</pre>"))
(when
(pos? (count error-inline))
(format-inline-error error-inline))]
(map
(fn*
[p1__18501#]
(str
(escape (:class p1__18501#))
": "
(escape (:message p1__18501#))))
(flatten-exception (:exception-data exception)))))
(when
last-message
[(str
"<div style=\"color: #AD4F4F; padding-top: 3px;\">"
(escape last-message)
"</div>")])),
:file file,
:line line,
:column column}))