This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-12
Channels
- # announcements (1)
- # architecture (112)
- # asami (22)
- # babashka (74)
- # beginners (189)
- # chlorine-clover (4)
- # cider (105)
- # clj-kondo (21)
- # clojure (45)
- # clojure-australia (1)
- # clojure-europe (26)
- # clojure-losangeles (4)
- # clojure-nl (3)
- # clojure-spec (5)
- # clojure-uk (8)
- # clojurescript (16)
- # conjure (1)
- # cursive (29)
- # datascript (21)
- # datomic (35)
- # events (1)
- # fulcro (12)
- # graalvm (3)
- # graphql (31)
- # kaocha (13)
- # malli (14)
- # meander (3)
- # mount (3)
- # off-topic (73)
- # pathom (9)
- # pedestal (5)
- # portal (2)
- # re-frame (4)
- # reagent (8)
- # reitit (3)
- # rum (1)
- # shadow-cljs (26)
- # spacemacs (3)
- # sql (6)
Hi, what's the recommended approach to translating Postgres constraint errors into user friendly error messages? (currently using next.jdbc and Hugsql if that helps)
I don't know of any libraries to handle that, so I assume folks use custom try
/`catch` logic.
at my previous job we had some regexes to pull apart the returned error strings from pg and turn it into a data structure. lots of matching on error types, error string, spec errors, etc
I have this ugly macro https://gist.github.com/lukaszkorecki/9568a224b9e14d7259bc5032ae30ffa1 - it's not great, but works for the most part