duct-framework / module.web

Duct module for running web applications
21 stars 19 forks source link

Fix #8 unhandled exception when parsing malformed body #9

Open LukasRychtecky opened 6 years ago

LukasRychtecky commented 6 years ago

This is just a preview, I want to sure about the code before writting tests.

weavejester commented 6 years ago

Thanks for the update! There's still a couple of issues:

  1. We shouldn't specify the default handler function in both the module and the middleware.
  2. The handler function you've added isn't a valid Ring handler function.

Instead, attach the Muuntaja error and content type as namespaced keys onto the request map (e.g. :muuntaja/error and muuntaja/content-type), and remove the default error handler. If the error handler is missing, don't wrap the exception and allow it to be thrown.

LukasRychtecky commented 6 years ago

@weavejester thanks for feedback. Sorry for a long running PR, but I've been really busy in last weeks. I expect I will finish it soon.