fix: assert was a no-op (fell through to Janet builtin); add proper Clojure assert macro that throws on falsy; err-message unwraps ex-info
This commit is contained in:
parent
aeaf1b624c
commit
3e12ef31e3
2 changed files with 19 additions and 2 deletions
|
|
@ -167,7 +167,11 @@
|
|||
(cond
|
||||
(string? err) err
|
||||
(and (or (table? err) (struct? err)) (= :jolt/exception (get err :jolt/type)))
|
||||
(let [v (get err :value)] (if (string? v) v (string/format "%q" v)))
|
||||
(err-message (get err :value))
|
||||
(and (or (table? err) (struct? err)) (= :jolt/ex-info (get err :jolt/type)))
|
||||
(let [m (get err :message) d (get err :data)]
|
||||
(if (and d (not (empty? d))) (string m " " (string/format "%q" d)) (string m)))
|
||||
(string? err) err
|
||||
(string/format "%q" err)))
|
||||
|
||||
(defn- report-error [err fib]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue