Created
April 7, 2015 18:57
-
-
Save Akii/c64bc36537b36f82fcee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @Flow\Scope("singleton") | |
*/ | |
class ApiProductionExceptionHandler extends ProductionExceptionHandler { | |
/** | |
* Only sends the HTTP header | |
* | |
* @param \Exception $exception The exception | |
* @return void | |
*/ | |
protected function echoExceptionWeb(\Exception $exception) { | |
$statusCode = 500; | |
if ($exception instanceof \TYPO3\Flow\Exception) { | |
$statusCode = $exception->getStatusCode(); | |
} | |
$statusMessage = \TYPO3\Flow\Http\Response::getStatusMessageByCode($statusCode); | |
if (!headers_sent()) { | |
header(sprintf('HTTP/1.1 %s %s', $statusCode, $statusMessage)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment