This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-21
Channels
- # announcements (5)
- # babashka (9)
- # beginners (84)
- # calva (47)
- # clara (3)
- # clj-kondo (2)
- # clojars (8)
- # clojure-australia (3)
- # clojure-europe (3)
- # clojure-spec (1)
- # clojurescript (5)
- # conjure (6)
- # cursive (7)
- # datahike (3)
- # events (2)
- # helix (1)
- # lsp (217)
- # luminus (4)
- # malli (18)
- # meander (23)
- # membrane (12)
- # off-topic (26)
- # pathom (12)
- # reagent (44)
- # releases (1)
- # rewrite-clj (2)
- # shadow-cljs (19)
- # sql (17)
- # xtdb (6)
Should throwing an exception from within a wrap-mutate
plugin surface as a mutation error? It seems that the error is being swallowed somewhere.
I think I’ve figured out what was causing my issue. I have a mutation that’s properly surfacing the error (from the plugin) when I call it regularly. However, if I specify keys to return from the mutation it’s resulting in the error not surfacing.
(pco/defmutation mutate [params]
{::plugins/params-spec (ds/spec ::spec {::id keyword?})}
{::params params})
(p.a.eql/process registry `[(mutate {::id "fail")])
;; Returns with a ::pcr/mutation-error
(p.a.eql/process registry `[{(mutate {::id "fail"}) [::params]}])
;; Returns {`mutate {}}
I added a failing test showcasing the difference in behavior in case that’s helpful. https://github.com/dehli/pathom3-plugins/blob/main/test/dehli/pathom3/plugins_test.cljc#L25-L33hello @U2U78HT5G, I found the issue on the part that filters the output, that was swallowing the error, fixed on master
on top of that, a few things I like to suggest after looking at your code:
- No need to provide plugin-id when using defplugin
- p.a.eql
alias should be used for async EQL, for sync it should be p.eql
Awesome, I’ll pull down latest! Also thanks for the suggestions! That’ll clean up the code!
oh, since you were so fast
I acutally pushed a bug, but just fixed
c50d2e75dd084190c58c0e5a599c8e3f1a88d9ef
should be fine