This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-27
Channels
- # announcements (2)
- # aws (17)
- # babashka (13)
- # beginners (84)
- # calva (46)
- # chlorine-clover (40)
- # cider (19)
- # clojure (27)
- # clojure-australia (1)
- # clojure-europe (84)
- # clojure-nl (2)
- # clojure-uk (49)
- # clojurescript (65)
- # core-async (6)
- # cryogen (1)
- # cursive (11)
- # datomic (13)
- # etaoin (3)
- # jackdaw (5)
- # jobs (2)
- # kaocha (34)
- # minimallist (6)
- # off-topic (17)
- # pathom (2)
- # pedestal (11)
- # re-frame (8)
- # reagent (5)
- # rewrite-clj (19)
- # shadow-cljs (30)
I don’t think I quite understand error handling. According to http://Pedestal.io:
> As long as there is an error attached to that key, Pedestal will not invoke the usual `:enter` and `:leave` functions. Instead, it looks for the next interceptor in the chain that has a `:error` function attached to it.
So I would expect that throwing an exception in the :enter
function would look for the exception handling Interceptor next in the queue. However, the behaviour actually seems to be the opposite: only Interceptors that come before the throwing Interceptor are considered.
I guess “the chain” really means “Interceptors that have been visited at least once”.
So should error handlers always be put at the very beginning of the Interceptors vector?
I found some tests with routing with :app-name
// :host
But I can't make it work. There is any sample app using this?
(i prefer tabular routes once all my routes are tabular at this moment)
https://github.com/pedestal/pedestal/blob/aa71a3a630dd21861c0682eeeebec762cbf3f85c/service/test/io/pedestal/http/route_test.clj#L285
I'm trying with
::http/routes (vec (concat
(route/expand-routes red-green)
(route/expand-routes todo-list)))
It throws
Execution error (AssertionError) at io.pedestal.http.route.definition.terse/eval12443$fn (terse.clj:52).
Assert failed: Cannot expand '[:path "/red"]' as a route. Expected a verb map or path string, but found a class clojure.lang.MapEntry instead
false
Pedestal is awesome. If there is docs for it, it would be a good clojure selling point
@U2J4FRT2T by using vec
you inadvertently switched routing syntax. FWIW, the docs do http://pedestal.io/reference/routing-quick-reference#_routes the relation between routing syntax and data structure type.