This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-15
Channels
- # announcements (10)
- # asami (5)
- # babashka (49)
- # babashka-sci-dev (8)
- # beginners (25)
- # calva (98)
- # cider (2)
- # clj-kondo (22)
- # clojure (32)
- # clojure-dev (12)
- # clojure-europe (32)
- # clojure-nl (3)
- # clojure-spec (3)
- # clojure-uk (10)
- # clojurescript (12)
- # community-development (1)
- # conjure (71)
- # cursive (7)
- # datalog (6)
- # events (2)
- # figwheel-main (2)
- # fulcro (4)
- # jobs (2)
- # kaocha (3)
- # lsp (43)
- # membrane (12)
- # missionary (9)
- # off-topic (61)
- # pathom (7)
- # polylith (2)
- # reagent (38)
- # remote-jobs (4)
- # shadow-cljs (17)
- # specter (1)
- # tools-deps (38)
- # vim (51)
- # web-security (5)
Hi there. What is the best way to catch and handle exceptions thrown within a mutation? E.g. I have a simple mutation that creates an entry in the database. If I feed bad input, the database will throw an exception but I can't seem to catch and process it with error-handler-plugin
and ::pc/process-error
, i.e. the provided error handling function is not triggered. I can, of course, handling it per mutation but I'd rather have a global handler that will take care of this for me. Thanks in advance.
Here's what I have for the parser
(p/parser {::p/env {::p/reader [p/map-reader pc/reader2 pc/ident-reader pc/index-reader]
::pc/mutation-join-globals [:tempids]
::pc/process-error (fn [env err]
(log/spy env)
(.printStackTrace err)
(p/error-str err))}
::p/mutate pc/mutate
::p/plugins [(pc/connect-plugin {::pc/register resolvers})
p/error-handler-plugin
(p/post-process-parser-plugin p/elide-not-found)]})
As stated previously there is no stacktrace printed.@U013F1Q1R7G there is a typo, its ::p/process-error
instead of ::pc/process-error
no worries, sorry for the sometimes confusing namespaces 😅