This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-06
Channels
- # announcements (12)
- # babashka (34)
- # beginners (85)
- # calva (76)
- # cider (14)
- # clj-kondo (49)
- # cljs-dev (32)
- # clojure (418)
- # clojure-europe (3)
- # clojure-france (4)
- # clojure-italy (17)
- # clojure-losangeles (8)
- # clojure-nl (5)
- # clojure-norway (2)
- # clojure-spec (2)
- # clojure-uk (88)
- # clojuredesign-podcast (4)
- # clojurescript (49)
- # clojurex (75)
- # clr (2)
- # core-async (13)
- # cursive (6)
- # datomic (57)
- # duct (31)
- # emacs (6)
- # fulcro (25)
- # graalvm (67)
- # graphql (13)
- # hoplon (1)
- # java (6)
- # juxt (11)
- # kaocha (5)
- # keechma (2)
- # leiningen (16)
- # mount (1)
- # off-topic (19)
- # pathom (2)
- # pedestal (1)
- # re-frame (11)
- # reagent (21)
- # reitit (22)
- # rewrite-clj (1)
- # shadow-cljs (98)
- # spacemacs (5)
- # sql (16)
- # tools-deps (8)
- # vim (28)
- # xtdb (4)
i have logging middleware that depends on the router's :match being present in normal cases, but i'd also want to log 404s
@vale you can put ["/*"]
as the last route, but then, all routes are run with linear-router, so, slow. What info do you need from a Match?
the route template. so that i can see endpoint stats without having to re-transform logs to get rid of path params
there wouldn't need to be a match at all. i could handle that as a special case.
(current) logger inside router: cannot log 404
logger outside router: no access to match object at all
maybe something instead of a match object, with some error-status, like :reitit.core/no-matching-path
or :reitit.core/no-matching-method
instead of returning nil
?
@ikitommi are you going to bump a sieppari version soon?, seems like the develop branch already fixes the issues that i found with the released version (is just for know what to do, becuase i'm building a system that depends on it)
additonally, what to you think about removing the sieppari.async.promesa
namespace and just use the completableFuture api for the three operations that AsyncContext need to implement? (promesa already works with completion stage so this will make it easy to use directly with promesa with no aditional namespace require dependencies, i'll do the PR for it)
Also, I think default support for core.async & manifold are removed from the master => the sieppari.core
loads in some hundreds of millis instead of 7+sec if you had c.a & m on classpath.
also, not sure anyone wan’t to support many async ways in a single dispatcher, the choice could be explicit.
I am getting Execution error (ExceptionInfo) at reitit.exception/exception (exception.cljc:19). No implementation of method: :into-interceptor of protocol: #'reitit.interceptor/IntoInterceptor found for class: io.pedestal.interceptor.Interceptor
when trying to use pedestal interceptors, namely io.pedestal.interceptor.error/error-dispatch
, when using reitit.pedestal
in 0.3.10
. Can i not use actually pedestal interceptors and only use the function/hashmap version in reitit.pedestal
?
Good PST morning! I’m having a bit of trouble understanding how to define custom spec transformers. A simplified version of my goal is to do something like this:
1. define a spec like (s/def ::amount decimal?)
2. create a spec transformer that transforms a string representation of a decimal amount (like “12.345678”) into a BigDecimal for all specs defined as predicate decimal?
, e.g. ::amount
.
First, I suppose I should confirm that this is this what Spec Transformers are designed to do. My understanding (or at least my hope) is that they allow you to register codecs with spec predicates. Is that correct?
I’ve read through https://www.metosin.fi/blog/spec-transformers/ and https://cljdoc.org/d/metosin/spec-tools/0.10.0/doc/spec-driven-transformations, but I still can’t quite figure out how to put the pieces together. CC @clojurians827
@jake142 how about https://cljdoc.org/d/metosin/spec-tools/0.10.0/doc/spec-coercion#spec-based-transformations
@tavistock Goal was to make it work, so sounds like a bug. Please write an issue out of that. Meanwhile you can say (into {} pedestal-interceptor)
to make it work