[TYPO3-core] RFC #????:

Martin Kutschker masi-no at spam-typo3.org
Fri Jul 10 15:08:58 CEST 2009


Oliver Hader schrieb:
> Hi Masi,
> 
> Martin Kutschker schrieb:
>>
>> If you think that 500 is too harsh make a suggestion for another HTTP
>> header as long as it signifies an error and is distinct from 200.
> 
> I see. If it's possible to consider an other HTTP status code as
> "failure" for that AJAX application I'd tend to use an own code.
> 
> Internet RFC #2616 states that the codes are extensible. Thus it would
> be possible to use "450" as response code. 4xx codes mean that the
> client did not send proper information and thus the application/server
> logic could not be processed.

I would rather use an existing one like "400 Bad Request" when eg a
check of the GET/POST arguments failed or "403 Forbidden" when eg the
session wasn't valid.

> The only thing that scares me with the 500 error code is that it will be
> written to a log file an server admins (that don't know anything about
> the application logic) start to investigate checking PHP/Apache/...
> settings...

So? When my script fails because of say a DB error then it's desirable
to get an entry in the log file.

Actually I want ALL errors to be logged so that's in my opinion. Note
that PHP changed also it's behaviour probably also to make AJAX clients
happy. IIRC newer PHP versions send a status 500 when the script dies.

All in all I still think it makes sense to send 500 in the case of any
error. If that's not good enough then I will provide a patch that lets
the developer set the status to whatever value she thinks is appropriate
(defaulting to 500).

Masi


More information about the TYPO3-team-core mailing list