This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-26
Channels
- # announcements (18)
- # aws (17)
- # babashka (19)
- # beginners (141)
- # calva (73)
- # cider (4)
- # clj-kondo (13)
- # cljs-dev (2)
- # clojure (97)
- # clojure-europe (6)
- # clojure-italy (5)
- # clojure-nl (1)
- # clojure-spec (25)
- # clojure-sweden (2)
- # clojure-uk (25)
- # clojured (3)
- # clojurescript (63)
- # core-typed (6)
- # cursive (23)
- # data-science (4)
- # datomic (74)
- # fulcro (19)
- # graalvm (18)
- # graphql (3)
- # hoplon (63)
- # jackdaw (1)
- # juxt (23)
- # london-clojurians (3)
- # meander (7)
- # off-topic (23)
- # om (1)
- # pathom (13)
- # pedestal (2)
- # perun (2)
- # re-frame (38)
- # reagent (3)
- # reitit (24)
- # shadow-cljs (91)
- # spacemacs (14)
- # sql (4)
- # tools-deps (8)
- # vim (3)
hi, hoping someone might be able give me some pointers I am having issues with an exception but I have no traceback
"class": "java.lang.Exception"
only the above message, I know it related to the body, if i run my function it returns a hash map successfully but when passed into body it returns the above message replacing the function call with a hash map works so it seems its related to converting to json or edn anyway i can get a full stack trace ?I have these middlewares enabled
swagger/swagger-feature
parameters/parameters-middleware
muuntaja/format-negotiate-middleware
muuntaja/format-response-middleware
exception/exception-middleware
muuntaja/format-request-middleware
coercion/coerce-response-middleware
coercion/coerce-request-middleware
iirc, I think you can get the full stack trace if you disable (un-comment) exception/exception-middleware
but it fails to give a full stack trace, I have figured out the issue now, basically database was not setup when run through the api
but I would love a way to get a full trace, seems this sort of error would have been easy to spot if it had not been hidden
I think I overrode the exception middleware (wrote my own) that wraps the original and logs the exception (available stacktrace). could also just print it, depends what you want.
oh yeah that works, seems counter intuitive would expect it to catch the full exception and return
Another question 🙂
any way to convert this format from honeysql to a json string
:release_date #clj-time/date-time "2019-04-30T23:00:00.000Z"
currently muuntaja is coercing it into its parts like below.
"release_date": {
"year": 2019,
"dayOfMonth": 30,
"dayOfYear": 120,
"dayOfWeek": 2,
"era": 1,
I have been looking into coercision via spec tools but finding it difficult to work with, figure this is a common requirement so likely an easier way ?
@oliver.marks check the last example here, about adding JodaTime support to Jsonista: https://github.com/metosin/jsonista#examples (and check Muuntaja/Reitit docs about adding those Jsonista options)
not having much luck with jsonista, perhaps i am confused. I have created a new muuntaja instance with (assoc-in [:formats "application/json" :encoder-opts :date-format] "yyyy-MM-dd")))) but it does not change the format
the link has you creating a mapper do you need to inject that mapper into the encoder-opts in some way
taking it to a much simpler example this is what I am testing with.
(def new-muuntaja-instance
(m/create
(-> m/default-options
(assoc-in [:formats "application/json" :encoder-opts :date-format] "yyyy-MM-dd"))))
(->> {:test (LocalDate. 0)}
(m/encode new-muuntaja-instance "application/json" )
(m/decode new-muuntaja-instance "application/json" ))
Is it possible with client side reitit to use both fragment routes and non-fragment routes simultaneously?