Closed dyba closed 10 years ago
I'm not quite sure what you expect this to do. You're assigning a :status
key to the request, rather than the response, so this middleware won't have any effect if there is malformed JSON. Your try-catch is also too wide - you're encompassing the handler, rather than the read-json
only.
I think I'm leaning toward using a option for this that contains a function, similar to #11, but without the problems I outline.
Oh, I guess I was working off some wrong assumptions about how ring is used. I'll take a look at your comments again on #11 and see if I can provide a solution that addresses the problems you raised.