Skip to content

Commit

Permalink
fix: better error handling/reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
armed committed Jun 16, 2022
1 parent 426a360 commit 963e1e0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/k16/gx/beta/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,10 @@
[processor arg-map]
(try
[nil (processor arg-map)]
(catch #?(:clj Exception :cljs js/Error) e
(catch #?(:clj Throwable :cljs js/Error) e
[(gx.err/gx-err-data "Signal processor error"
{:ex-message (impl/error-message e)
:ex (or (ex-data e) e)
:args arg-map})
nil])))

Expand Down
3 changes: 1 addition & 2 deletions src/k16/gx/beta/errors.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@
(defmethod humanize :node-signal
[{:keys [internal-data] :as error}]
(humanize-error
error (when-let [{:keys [ex-message args dep-node-keys]} internal-data]
error (when-let [{:keys [ex-message dep-node-keys]} internal-data]
(tokenize "error = " ex-message
"args = " args
"deps-nodes = " dep-node-keys))))

(comment
Expand Down
7 changes: 6 additions & 1 deletion src/k16/gx/beta/system.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
(when-let [gx-map (get @registry* system-name)]
(node-props gx-map :gx/value)))

(defn failures
(defn node-failures
[system-name]
(when-let [gx-map (get @registry* system-name)]
(let [{:keys [components static]} (node-props gx-map :gx/failure)
Expand All @@ -48,6 +48,11 @@
(seq failed-comps) (assoc :components failed-comps)
(seq failed-static) (assoc :static failed-static)))))

(defn failures
[system-name]
(when-let [gx-map (get @registry* system-name)]
(:failures gx-map)))

(defn failures-humanized
[system-name]
(when-let [gx-map (get @registry* system-name)]
Expand Down

1 comment on commit 963e1e0

@vercel
Copy link

@vercel vercel bot commented on 963e1e0 Jun 16, 2022

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-git-master-kepler16.vercel.app
gx-kepler16.vercel.app
gx.kepler16.com

Please sign in to comment.