This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-18
Channels
- # aleph (59)
- # beginners (21)
- # bigdata (1)
- # boot (110)
- # cider (7)
- # clara (1)
- # cljs-dev (160)
- # cljsjs (3)
- # clojars (10)
- # clojure (122)
- # clojure-czech (2)
- # clojure-dusseldorf (5)
- # clojure-france (1)
- # clojure-italy (4)
- # clojure-korea (5)
- # clojure-russia (13)
- # clojure-spec (15)
- # clojure-uk (78)
- # clojurebridge (1)
- # clojurescript (196)
- # core-async (6)
- # core-logic (27)
- # cursive (11)
- # data-science (2)
- # datomic (45)
- # dirac (9)
- # emacs (2)
- # funcool (8)
- # hoplon (16)
- # immutant (13)
- # jobs (1)
- # klipse (11)
- # lein-figwheel (1)
- # leiningen (1)
- # off-topic (3)
- # om (40)
- # onyx (31)
- # pedestal (25)
- # re-frame (55)
- # ring (1)
- # ring-swagger (1)
- # rum (4)
- # specter (1)
- # sql (2)
- # untangled (30)
- # vim (12)
- # yada (12)
Is there a sample of how to handle fileupload or just multipart/form-data with pedestal?
There was some discussion of this in https://github.com/pedestal/pedestal/issues/444
(At my fingertips because I'm working on a doc that should incorporate that info. Like right now.)
Hello! How do I handle internal erros(exceptions)?
curl '
returns text/plain
500
Internal server error
Internally: clojure.lang.ExceptionInfo: Interceptor Exception: URLDecoder: Incomplete trailing escape (%) pattern
Can I intercept/handle this to make a custon response?
awesome thanks, I will check that out
Hi @souenzzo. You sure can. Take a look at http://pedestal.io/reference/error-handling and let me know if it tells you what you need to know.
My :else
on io.pedestal.interceptor.error/error-dispatch
macro.
I'ts my first interceptor on (def r table-routes [["/query" :get [err-interceptor query] :route-name :query])
OK, I've got an explanation and a solution for you. Which would you like to have first? 🙂
1. Instead of putting the error handling in your routes, you will need to have it come early in the chain of interceptors. Before the router, in fact. The way to do this is as follows:
- Call io.pedestal.http/default-interceptors
with your service map. The result will be a service map with the default interceptors attached.
- Prepend your error handler to the :io.pedestal.http/interceptors
key in the service map.
- Call create-servlet
or create-server
as normal. The default interceptors will not be appended a second time.
2. Explanation: the exception is happening before a route is selected by the router. Thus, your error handling interceptor never gets pushed onto the stack.