Skip to content

Commit

Permalink
Fix error in Application
Browse files Browse the repository at this point in the history
  • Loading branch information
honzapospi committed Oct 8, 2016
1 parent 81a28aa commit 131883f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public function run(){
if(!$routeResponse)
throw new BadRequestException('Unsupported '.$this->request->method.' request');
$instance = $this->container->getByType($routeResponse['classname']);
if(!$instance instanceof IPresenter) {
throw new ApplicationException('Class "' . $routeResponse['classname'] . '" must be instance of RestServer\IPresenter');
if(!$instance instanceof IController) {
throw new ApplicationException('Class "' . $routeResponse['classname'] . '" must be instance of RestServer\IController');
}
$response = $this->responseFactory->create();
$this->onBeforeRun($this, $instance, $routeResponse['pathParameters']);
Expand Down Expand Up @@ -88,7 +88,7 @@ private function renderException(\Exception $e, $code){
$error = array(
'message' => $e->getMessage()
);
$response->errors = array($error);
$response->error = array($error);
$response->setStatusCode($code);
$this->renderer->send($response);
} else {
Expand Down

0 comments on commit 131883f

Please sign in to comment.