This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-05
Channels
- # arachne (7)
- # architecture (3)
- # beginners (106)
- # cider (22)
- # clara (2)
- # cljs-dev (14)
- # cljsrn (12)
- # clojure (121)
- # clojure-china (1)
- # clojure-italy (2)
- # clojure-spec (22)
- # clojure-uk (32)
- # clojurescript (38)
- # community-development (45)
- # cursive (15)
- # datascript (6)
- # datomic (12)
- # defnpodcast (2)
- # emacs (8)
- # events (1)
- # fulcro (14)
- # immutant (6)
- # jobs (3)
- # jobs-discuss (6)
- # jobs-rus (3)
- # keechma (4)
- # keyboards (4)
- # leiningen (8)
- # luminus (1)
- # off-topic (91)
- # onyx (13)
- # parinfer (36)
- # re-frame (12)
- # reagent (23)
- # remote-jobs (1)
- # ring-swagger (3)
- # shadow-cljs (57)
- # specter (11)
- # sql (9)
- # uncomplicate (4)
- # vim (2)
- # yada (15)
I am wondering why the exception handling doesn't work correctly when it's thrown from a referenced library (JAR file). I have a route like this
(GET "/token" []
:summary "Returns auth token"
:current-user user
(ok (ipex/get-token (:email user)))) ; throws exception
get-token
looks like this
(try (:body (client/post (str (:url api-config) "/auth/token") (merge ipex-http-client-config
{:form-params {:identityType "email"
:identityValue user-email}})))
(catch Exception ex
(ex-info "Problem connecting to the IPEX" {:cause :ipex-api} ex))))
When the exception is thrown, I can see following error in server log
java.lang.IllegalArgumentException: No implementation of method: :write-body-to-stream of protocol: #'ring.core.protocols/StreamableResponseBody found for class: clojure.lang.ExceptionInfo
Why its not handled via exception handlers in my api-config? It works for all other exceptions except this one particular case (I am hanndling exceptions with ex/default exception-handler
)@petr.mensik I think you need to throw the exception as well — ex-info
only creates the exception, but doesn’t throw it.
@karl omg I am so stupid 🙂 You are right of course