Skip to content

Commit

Permalink
fix renderJsonErrorMessage - was overriding it self
Browse files Browse the repository at this point in the history
  • Loading branch information
nogo committed Feb 23, 2016
1 parent 2597d9e commit e5873ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Slim/Handlers/PhpError.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,15 @@ protected function renderHtmlError(Throwable $error)
*/
protected function renderJsonErrorMessage(Throwable $error)
{
$error = [
$json = [
'message' => 'Slim Application Error',
];

if ($this->displayErrorDetails) {
$error['error'] = [];
$json['error'] = [];

do {
$error['error'][] = [
$json['error'][] = [
'type' => get_class($error),
'code' => $error->getCode(),
'message' => $error->getMessage(),
Expand All @@ -243,7 +243,7 @@ protected function renderJsonErrorMessage(Throwable $error)
} while ($error = $error->getPrevious());
}

return json_encode($error, JSON_PRETTY_PRINT);
return json_encode($json, JSON_PRETTY_PRINT);
}

/**
Expand Down

0 comments on commit e5873ec

Please sign in to comment.