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

Oliver Hader oliver at typo3.org
Fri Jul 10 14:46:38 CEST 2009


Hi Masi,

Martin Kutschker schrieb:
> Oliver Hader schrieb:
>> Martin Kutschker schrieb:
>> However, a HTTP 500 error code means the following:
>> | The server encountered an unexpected condition which prevented it from
>> | fulfilling the request.
> 
> When an AJAX script sets the error code not send the requested data (be
> it XML or JSON). At least my scripts set the AJAX error flag when
> something bad happened.
> 
>> The request was fulfilled but a misbehaviour was encountered during
>> runtime. A 500 error code should be used only when something crashed or
>> whatever - which is not the case here.

A 5xx HTTP error indicates that the server was not able to perform the
request. However, the request has finished sucuessfully, but the
application one layer below encountered a misbehaviour during runtime.

> How do define a crash? Let's assume the script has problems with it's
> data and has to stop processing. So it sets the AJAX error flag. In this
> condition it MUST NOT send a status 200. At least not in my opinion.
> 
>> However, I'd be fine with using a HTTP header like
>> | X-TYPO3-Error: 550 The given command could not be processed
> 
> This is pointless. The idea is to send a status that AJAX libs around
> the world can interpret as failure without having to have knowledge
> about TYPO3.
> 
> 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.

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...

olly
-- 
Oliver Hader
TYPO3 Release Manager 4.3


More information about the TYPO3-team-core mailing list