(ex-data ex)
Returns exception data (a map) if ex is an IExceptionInfo. Otherwise returns nil.
(try
(let [response (http/post
"http://localhost:8080/v1/leads"
{:form-params {:foo "somethingBad"}})]
(prn "This is the response" response))
(catch Exception e
(prn "This is the error" (ex-data e))))
-------
> "This is the error" {:status 500, :headers {"Content-Type" "application/json;
charset=utf-8", "Content-Length" "73", "Server" "http-kit", "Date" "Mon, 10 Oct 2016
16:53:12 GMT"}, :body "{\\"type\\":\\"unknown-
exception\\",\\"class\\":\\"java.lang.IllegalArgumentException\\"}", :request-time 7,
:trace-redirects ["http://localhost:8080/v1/leads"], :orig-content-encoding nil}