This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-14
Channels
- # beginners (31)
- # boot (9)
- # cider (10)
- # cljs-dev (9)
- # cljsrn (16)
- # clojure (222)
- # clojure-austin (4)
- # clojure-france (13)
- # clojure-italy (21)
- # clojure-nl (2)
- # clojure-russia (71)
- # clojure-spec (9)
- # clojure-uk (39)
- # clojurescript (50)
- # cursive (16)
- # datomic (69)
- # dirac (2)
- # figwheel (1)
- # graphql (19)
- # hoplon (4)
- # jobs (1)
- # klipse (3)
- # leiningen (4)
- # liberator (3)
- # luminus (9)
- # lumo (9)
- # off-topic (3)
- # om (21)
- # onyx (11)
- # parinfer (2)
- # pedestal (8)
- # planck (19)
- # re-frame (17)
- # reagent (12)
- # remote-jobs (1)
- # ring-swagger (3)
- # spacemacs (17)
- # specter (23)
- # sql (1)
- # unrepl (64)
- # untangled (19)
- # yada (5)
Hi, i’m going through web development in clojure 2nd edition and I can’t figure out why i’m getting a http 412 error https://gist.github.com/anonymous/2428913e718c68e6bc64cf4c261c12e9
it looks like there is an extra set of parens here:
((try
(db/create-user!
(-> user
(dissoc :pass-confirm)
(update :pass hashers/encrypt)))
(-> {:result :ok}
(response/ok)
(assoc :session (assoc session :identity (:id user))))
(catch Exception e
(handle-registration-error e))))
should just be:
(defn register! [{:keys [session]} user]
(if (registration-errors user)
(response/precondition-failed {:result :error})
(try
(db/create-user!
(-> user
(dissoc :pass-confirm)
(update :pass hashers/encrypt)))
(-> {:result :ok}
(response/ok)
(assoc :session (assoc session :identity (:id user))))
(catch Exception e
(handle-registration-error e)))))
@yogthos Ok, I removed that extra set of parenthesis and I got the same error. I also ran ‘lein clean’, ‘lein deps’ then restarting my repl in hopes of clearing everything out
BTW (.startsWith "ERROR: duplicate key value")
PG error depends on system local language, is there a language agnostic solution to catch an error?