diff --git a/src/Application.php b/src/Application.php index 946e1f8..3c4092a 100644 --- a/src/Application.php +++ b/src/Application.php @@ -83,7 +83,6 @@ 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); @@ -91,10 +90,12 @@ public function run(){ 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);