This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-24
Channels
- # admin-announcements (1)
- # aleph (3)
- # announcements (4)
- # beginners (30)
- # boot (296)
- # cider (21)
- # cljsjs (2)
- # cljsrn (18)
- # clojure (124)
- # clojure-poland (23)
- # clojure-russia (4)
- # clojurescript (73)
- # core-async (58)
- # css (3)
- # datomic (31)
- # editors (4)
- # emacs (35)
- # euroclojure (3)
- # hoplon (104)
- # immutant (8)
- # jobs (3)
- # jobs-discuss (1)
- # keechma (1)
- # ldnclj (33)
- # leiningen (5)
- # liberator (1)
- # mount (20)
- # off-topic (2)
- # om (104)
- # onyx (54)
- # parinfer (80)
- # proton (1)
- # re-frame (59)
- # remote-jobs (1)
- # ring-swagger (9)
- # slack-help (15)
- # spacemacs (7)
- # yada (12)
Hey, wondering if y’all would be amenable to a PR for something. I frequently find that when I’ve got a response body that doesn’t match a schema, the only thing I get back is the schema validation errors, and I’d like to log the response body I was trying to return at that time. So what I’d like to do is assoc it into the (ex-info)
call here:
https://github.com/metosin/compojure-api/blob/master/src/compojure/api/meta.clj#L66
…and then in my custom error handler I can retrieve it and log it.
It would basically be something like (assoc body :type ::ex/response-validation :failed-body (:body response))
You can just replace the exception handler for schema errors
ah no
Yes, I think this would be useful
Also think it’s a great idea. It could have more info too, like the :in
defining what was the coercion about. Something like in Kekkonen: https://github.com/metosin/kekkonen/blob/master/src/kekkonen/core.clj#L299-L311
It would make sense to move error from top-level map to some property, but that would break existing response validation error handlers so not sure if we want to change that