node-ecstatic icon indicating copy to clipboard operation
node-ecstatic copied to clipboard

Most status code handlers don't have a way of delegating to next()

Open jfhbrook opened this issue 5 years ago • 1 comments

#247 flagged an issue where many (non-404) status codes aren't respecting handleError=false and always respond with an ecstatic-served error page.

I think error handling in ecstatic is a little bizarre anyway - see #154 and #183, which are both issues that request different error handling behavior. This is just yet another one, I guess.

jfhbrook avatar Apr 13 '19 20:04 jfhbrook

Actually, I think it's not that bad. If we assume the following:

if next is thruthy, act like a middleware. if next is falsy, act like a server.

Only the 400 handler needs to be fixed to actually forward to the next middleware.

Also, we have to make sure all the 500 cases are actually able to forward to next and properly consider handlError.

I've updated the PR for this.

ronag avatar Apr 14 '19 12:04 ronag