node-ecstatic
node-ecstatic copied to clipboard
Most status code handlers don't have a way of delegating to next()
#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.
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.