Skip to content

Commit

Permalink
Do not display internal error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Pospisil committed Dec 6, 2016
1 parent 61c1675 commit 7989623
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,19 @@ public function run(){
} catch (ForbiddenRequestException $e){
$this->renderException($e, 403);
} catch (\Exception $e){
//Debugger::log($e);
$this->renderException($e, 500);
}
return $this->renderer->send($response);
}

private function renderException(\Exception $e, $code){
Debugger::log($e->getMessage(), $code);
if($code >= 500)
Debugger::log($e);
if($this->catchExceptions){
$response = $this->responseFactory->create();
$error = array(
'message' => $e->getMessage()
'message' => $code < 500 ? $e->getMessage() : 'Internal server error.'
);
$response->error = array($error);
$response->setStatusCode($code);
Expand Down

0 comments on commit 7989623

Please sign in to comment.