Skip to content

Commit

Permalink
fix(TRE-1096): in some cases wrong cause is thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
armed committed Jan 26, 2023
1 parent 78068ed commit 53d0263
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions repl_sessions/config_with_error.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{:foo #object["asdfas"]}
19 changes: 19 additions & 0 deletions repl_sessions/errors.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(ns errors
(:require [k16.gx.beta.system :as gx.system]))


(def server
{:gx/component
{:gx/start {:gx/processor (fn [_] (clojure.edn/read-string
(slurp "repl_sessions/config_with_error.edn")))}
:gx/stop {:gx/processor (fn [_] nil)}}})

(def config
{:options {:port 8080
:secure? false}
:server {:gx/component 'errors/server
:gx/props {:foo '(gx/ref :options)}}})

(gx.system/register! ::err {:graph config})
@(gx.system/signal! ::err :gx/start)
(println (gx.system/failures-humanized ::err))
4 changes: 2 additions & 2 deletions src/k16/gx/beta/system.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

(defn throw-root-exception!
[failures]
(let [{:keys [message causes node-key]} (last failures)
(let [{:keys [message causes node-key] :as f} (last failures)
{:keys [exception]} (first causes)]
(let [msg (str node-key
"\n\t" message
(when exception
(str "\n\t" (ex-message exception))))]
(throw (ex-info msg {:failures failures})))))
(throw (or exception (ex-info msg {:failures failures}))))))

(defn states
"Gets list of states of the graph as map.
Expand Down

1 comment on commit 53d0263

@vercel
Copy link

@vercel vercel bot commented on 53d0263 Jan 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

gx – ./

gx-kepler16.vercel.app
gx.kepler16.com
gx-git-master-kepler16.vercel.app

Please sign in to comment.