Hi!
I'm developing a PHP application that uses HTTP response codes for communication as well as response bodies.
So this is a typical scenario in the PHP code:
try {
doSomething();
} catch(Exception $e) {
header('HTTP/1.1 500 Internal Server Error');
}
... and the typical code in clients looks like:
switch(responseCode) {
case 200 :
// all fine
// ....
case 500 :
// trouble!
}
This is cool, as long as every error is well catched in PHP code.
The problem: If, for any reason in the php code occures an uncatched error, apache will send 200 OK. But I wan't apache to say 500. Maybe per .htaccess or so.
Any suggestions?