forked from PHP/Router
Remove 404 exception
This commit is contained in:
parent
a90b93b33f
commit
8a533c8005
|
@ -80,7 +80,7 @@ trait SegmentRouterTrait
|
|||
$carry[] = $segment;
|
||||
$node = $node[':x'];
|
||||
} else {
|
||||
throw new \Exception('404');
|
||||
return ['code' => 404, 'handler' => null, 'params' => null];
|
||||
}
|
||||
return $carry;
|
||||
},
|
||||
|
|
|
@ -88,7 +88,7 @@ for ($i = 0; $i < 10; $i++) {
|
|||
|
||||
$res = SegmentRouter::lookup($routes, $method, $uri);
|
||||
if ($res['code'] !== 200) {
|
||||
echo "Failed to handle request for $uri - $res\n";
|
||||
echo "Failed to handle request for $uri - " . json_encode($res) . "\n";
|
||||
exit(1);
|
||||
}
|
||||
$res['handler'](...$res['params']);
|
||||
|
|
Loading…
Reference in New Issue
Block a user