Fork me on GitHub

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: …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


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:


(It might not be a good idea to pass the Schema, as it might not serialize)


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


sure, would have been ok to break that for 1.0.0, but could be just an addition now.