Skip to content

Commit

Permalink
Fix browser tests not compiling [hotfix]
Browse files Browse the repository at this point in the history
  • Loading branch information
ggeoffrey committed Feb 9, 2024
1 parent 689f5c4 commit f877679
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/hyperfiddle/electric.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand All @@ -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 _)))))
Expand Down

0 comments on commit f877679

Please sign in to comment.