Closed marioizquierdo closed 12 years ago
I think this is a bug. Pull request away :)
This is actually not a bug. Our nginx configs have proxy_intercept_errors on, so if you return status 404 nginx will ignore what you send and render whatever is set to error_page 404. So the only way for errship to control it is to return status 200. It's not semantic, no, but since it's just an error page for users and not for REST APIs, it's not a big deal.
Hmm, its not beautiful but probably does not make sense to complicate things more. Having that in mind, I think the only thing we need is improve the documentation.
I will add a pull request with some comments on it.
Thanks.
On Tue, Nov 1, 2011 at 5:08 PM, Brennan Frydl < reply@reply.github.com>wrote:
This is actually not a bug. Our nginx configs have proxy_intercept_errors on, so if you return status 404 nginx will ignore what you send and render whatever is set to error_page 404. So the only way for errship to control it is to return status 200. It's not semantic, no, but since it's just an error page for users and not for REST APIs, it's not a big deal.
Reply to this email directly or view it on GitHub: https://github.com/agoragames/errship/issues/11#issuecomment-2595947
Thanks Brennan - I knew we'd done it that way for a reason, but I couldn't recall what it was.
Agree with Mario that we should just make a note in our documentation to reflect our reasoning.
Maybe this should be configurable? I'd prefer it if the error pages return the correct http code. The default behavior could stay the same. I can supply a patch if you think it makes sense.
For our internal use we don't need it, but we'd accept a pull request or patch for it.
I have merged @fschwahn's pull request and released as Errship 2.2.0. See README for details.
The rescuers are not using the right http status, for example:
will return HTTP status 200. I think it should be:
This is confusing me in some specs of my application; the next example should be ok and it fails like this:
The only way to check (in rspec) if the error page was raised is with:
But this is not very semantic, and it's coupled to the errship implementation.
Was it intentional? Otherwise I can supply a pull request.
Thanks, Mario Izquierdo.