macchiato-framework / macchiato-core

Ring style HTTP server abstraction for Node.js
MIT License
378 stars 35 forks source link

Fix error handler being called incorrectly when exception during response processing #34

Closed zk closed 6 years ago

zk commented 6 years ago

In macchiato-core 0.2.13, an exception encountered during request processing will prevent the node server from responding, causing the client to time out.

The cause can be seen here:

https://github.com/macchiato-framework/macchiato-core/blob/e5ec039ad0c028736c5ecfa21c439bb217813248/src/macchiato/http.cljs#L118

The third parameter to response should be the result of calling error-handler, not the function itself.

I've also changed the behavior of error handler to return the toString of the entire error instead of just the message (second commit in this PR), but feel free to roll that back if you feel that's not appropriate.

yogthos commented 6 years ago

Thanks, just pushed out 0.2.14 with the fix.

zk commented 6 years ago

Thanks Dmitri

On Sat, Jul 14, 2018 at 4:08 AM Dmitri Sotnikov notifications@github.com wrote:

Thanks, just pushed out 0.2.14 with the fix.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/macchiato-framework/macchiato-core/pull/34#issuecomment-405025919, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAcGnVpkywJy-nlTYxDqmJNN48KF-24ks5uGftUgaJpZM4VPw8n .