* Michael Peters <[EMAIL PROTECTED]> [2006-06-05T12:29:51]
> Rob Kinyon wrote:
> > Isn't a 500 more appropriate here given that 404 is more of a
> > webserver error and 500 is more of an application error? Yes, I
> > understand that C::A::Dispatch is playing a webserver on TV, but it's
> > still an app-related issue. Rails's routesmapping and Catalyst's
> > responder maps are both 500 errors.
> 
> I don't know. If my application has a URL like:
> 
> /app/foo
> 
> which works, and the user types in "/app/foos", which is not a valid URL what
> kind of message would you expect to recieve? If you said a 500, then what if I
> tell you that I'm not even using Dispatch (maybe app/foo/index.html exists).
> Should the error message change from a 404 to a 500 just because I'm handling
> the URL mapping in a different way?

I'm with Michael, here.  I don't buy the webserver/application error
description.  4xx is an error caused by a bad request from the client.  5xx is
a failure by the server to fulfill an apparently valid request.

If /app/foos does not map to a resource, and the client should not be
requesting it, 4xx is the correct response class.  404 seems like a very
reasonable code, given that no resource (read: runmode) was found to map that
request.

> didn't find a way to dispatch it. I don't think that's an error. If however
> there is some serious desire for this to be a 500 instead of a 404, then I'd
> consider making it configurable. BTW, you can probably tell from my comment,
> but I think both Rails and Catalyst made a mistake in choosing a 500 error
> for this.

Making it configurable might be useful in the future anyway, for the truly
pedantic to implement 410 codes when they refactor.  I believe, strongly, that
404 is the correct default response.

-- 
rjbs

Attachment: signature.asc
Description: Digital signature

Reply via email to