Skip to content

Commit

Permalink
fix: always throw exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ipranjal committed Feb 3, 2021
1 parent f2483e1 commit 91d9688
Showing 1 changed file with 15 additions and 24 deletions.
39 changes: 15 additions & 24 deletions src/RouterEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,37 +88,28 @@ public function __construct(Request $request, RouteCollection $collection, $apiM
*/
public function route()
{
try {

// Get URL and request method.
$this->request_method = strtolower($this->request->getMethod());
// Get URL and request method.
$this->request_method = strtolower($this->request->getMethod());

if ($this->check_manual()) {
return true;
}

//Break URL into segments
$this->path_info = explode('/', $this->request->getPathInfo());
if ($this->apiMode) {
array_shift($this->path_info);
}
if ($this->check_manual()) {
return true;
}

//Break URL into segments
$this->path_info = explode('/', $this->request->getPathInfo());
if ($this->apiMode) {
array_shift($this->path_info);
}

$this->getController();
$this->method = $this->getMethod($this->controller);
$this->request->attributes->set('_controller', $this->controller . '::' . $this->method);
array_shift($this->path_info);

$this->setArguments();
return true;
} catch (\Exception $e) {
$this->getController();
$this->method = $this->getMethod($this->controller);
$this->request->attributes->set('_controller', $this->controller . '::' . $this->method);

if ($this->apiMode) {
return false;
} else {
throw $e;
}
}
$this->setArguments();
return true;

}

Expand Down

0 comments on commit 91d9688

Please sign in to comment.