Skip to content

Commit

Permalink
Display path in BarRequestException
Browse files Browse the repository at this point in the history
  • Loading branch information
honzapospi committed Nov 16, 2016
1 parent 9d4178f commit b9a12e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ public function run(){
// accept /?path=/endpoint AND index.php?path=/endpoint
if($path == '/' || $path == '/index.php' && $this->request->getQuery('path'))
$path = $this->request->getQuery('path');
$path = $path ? $path : '/';
$routeResponse = $this->routeList->match($path, $this->request->method);
if(!$routeResponse)
throw new BadRequestException('Unsupported '.$this->request->method.' request');
throw new BadRequestException('Unsupported '.$this->request->method.' '.$path.' request');
$instance = $this->container->getByType($routeResponse['classname']);
if(!$instance instanceof IController) {
throw new ApplicationException('Class "' . $routeResponse['classname'] . '" must be instance of RestServer\IController');
Expand Down

0 comments on commit b9a12e9

Please sign in to comment.