From f8776792bb24a3b8b81baa509e5758fea7d20d28 Mon Sep 17 00:00:00 2001 From: Geoffrey Gaillard Date: Fri, 9 Feb 2024 11:02:28 +0100 Subject: [PATCH] Fix browser tests not compiling [hotfix] --- src/hyperfiddle/electric.cljc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hyperfiddle/electric.cljc b/src/hyperfiddle/electric.cljc index e6a983b8a..36ee0b203 100644 --- a/src/hyperfiddle/electric.cljc +++ b/src/hyperfiddle/electric.cljc @@ -497,6 +497,10 @@ Quoting it directly is idiomatic as well." (contrib.str/align-regexp #" at ") (dbg/left-pad-stack-trace 4))))) +(cc/defn- log-on-server-that-error-happened-on-client [] + ;; FIXME should be inlinable, but Electric fails to resolve log/info var in a `server` block. + #?(:clj (log/info "This is a client-side exception. The full exception was printed on the client."))) + (hyperfiddle.electric/defn ?PrintClientException [msg id] (server (let [async-trace (::dbg/trace (ex-data lang/trace))] @@ -505,7 +509,7 @@ Quoting it directly is idiomatic as well." (if-some [ex (io/get-original-ex id)] (do (client-log-client-error ex async-trace) - (try (server (log/info "This is a client-side exception. The full exception was printed on the client.")) + (try (server (log-on-server-that-error-happened-on-client)) (catch Pending _))) (client-log-server-error msg async-trace))) (catch Pending _)))))