Skip to content

Commit

Permalink
change Exceptions/ExceptionHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
wazsmwazsm committed Jul 14, 2018
1 parent 1efbd7a commit 67e127d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/WorkerF/Exceptions/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public function handle(\Exception $e)
{
$httpCode = 500;
// create http response header
if (property_exists($e, 'httpCode')) { // is a http exception
if (property_exists($e, 'httpCode') &&
array_key_exists($e->httpCode, Response::$statusCodes)
) { // is a http exception
$httpCode = $e->httpCode;
$header = Response::$statusCodes[$httpCode];
} else { // other exception
Expand Down

0 comments on commit 67e127d

Please sign in to comment.