From 2e19a95580d80d102eed3da3d9966c5f8959ef32 Mon Sep 17 00:00:00 2001 From: Timothy Pratley Date: Wed, 13 Oct 2021 16:06:07 -0700 Subject: [PATCH] set `error` on ex-info for better broswer support See discussion https://ask.clojure.org/index.php/11159/suggestion-to-improve-default-info-printing-clojurescript To observe the behavior, try throwing these two expressions: (throw (ex-info "oh no" {})) (throw (set! (.-error (ex-info "oh no" {})) "oh no")) And observe that the second form is more browser friendly. --- src/main/cljs/cljs/core.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/cljs/cljs/core.cljs b/src/main/cljs/cljs/core.cljs index d316c559f..3ee2c22fa 100644 --- a/src/main/cljs/cljs/core.cljs +++ b/src/main/cljs/cljs/core.cljs @@ -11477,6 +11477,7 @@ reduces them without incurring seq initialization" (let [e (js/Error. message)] (this-as this (set! (.-message this) message) + (set! (.-error this) message) (set! (.-data this) data) (set! (.-cause this) cause) (do