Fork me on GitHub
#reitit
<
2020-02-02
>
dharrigan16:02:45

Hi @ikitommi On this page: https://metosin.github.io/reitit/basics/error_messages.html, the link at the bottom re: Runtime Exception links to a md page that instead of loading in the browser, downloads the page (i.e., it's not html).

dharrigan16:02:09

Opens up in emacs as md for me 😉

ikitommi16:02:05

oh, please fix 🙂

dharrigan16:02:56

There you go - it renders locally, hope it works when generating doc for the web 🙂

ikitommi16:02:57

merged, thanks!

joefromct16:02:36

Hi, i'm wondering if anyone has any tips on how to work around the inconsistencies of stripping keys when using edn vs json as described in https://github.com/metosin/reitit/issues/317 I'm finding some of my unit tests are complaining and i'm re-writing the same tests for different serialization/formatters. (i.e. i bug popped up with json values being null because they hadn't been coerced, but edn/etc. passes all tests...) Any tips appreciated, thanks.

ikitommi17:02:21

@joefromct that should be fixed in 0.4.0

joefromct17:02:53

ah, ok. let me read up on that. maybe my fix is as easy as updating.

dharrigan19:02:02

So, having an issue - I've seen before, but can't seem to resolve this time. I'm trying to look at writing a little exception handler for specific business use-cases internal to my system. Therefore, just kicking the tyres atm, and wrote a very very basic, mostly-a-copy-of-the-example one. When I eval the ring-handler (router), I get the map as I expect (i.e., :status, :body...etc), but when it reaches jetty, it has blown up with this error java.lang.IllegalArgumentException: No implementation of method: :write-body-to-stream of protocol: #'ring.core.protocols/StreamableResponseBody found for class: clojure.lang.PersistentArrayMap

dharrigan19:02:19

I think that's because a problem in trying to serialise out the structure as json

dharrigan19:02:42

But for the life of me, I can't see where in my code I'm deviating (that far) from the example!

dharrigan19:02:35

Here's the code:

dharrigan20:02:16

order is important in defining the middleware stack

dharrigan20:02:37

This muuntaja/format-middleware must come before the exception-middleware