Skip to content

Commit

Permalink
Show ex-cause of error when set
Browse files Browse the repository at this point in the history
  • Loading branch information
mk committed Oct 7, 2024
1 parent dcfdc81 commit dc3912e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nextjournal/clerk.clj
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
(throw (ex-info (str "`nextjournal.clerk/show!` encountered an eval error with: `" (pr-str file-or-ns) "`") {::doc (assoc doc :blob->result blob->result)} e))))]
(println (str "Clerk evaluated '" file "' in " time-ms "ms."))
(webserver/update-doc! result))
(catch Exception e
(webserver/update-doc! (-> e ex-data ::doc (assoc :error e) (update :ns #(or % (find-ns 'user)))))
(catch clojure.lang.ExceptionInfo e
(webserver/update-doc! (-> e ex-data ::doc (assoc :error (or (ex-cause e) e)) (update :ns #(or % (find-ns 'user)))))
(throw e))))))

#_(show! "notebooks/exec_status.clj")
Expand Down

0 comments on commit dc3912e

Please sign in to comment.