|
@@ -96,11 +96,16 @@ class Route
|
|
|
{
|
|
|
$route = self::getInstance();
|
|
|
$uriInfo = $route->getUriInfo($request->getPathInfo());
|
|
|
+ $resourceExists = false;
|
|
|
foreach ($route->resources as $resource) {
|
|
|
if (in_array($uriInfo['uri'], $resource->uriList)) {
|
|
|
$route->callController($resource, $request, $uriInfo);
|
|
|
+ $resourceExists = true;
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+ if (! $resourceExists) {
|
|
|
+ throw new \Exception('Error getting the Resource: ' . __FUNCTION__);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -111,7 +116,7 @@ class Route
|
|
|
*
|
|
|
* @param string $path The request path
|
|
|
*
|
|
|
- * @return arrray
|
|
|
+ * @return array
|
|
|
*/
|
|
|
public function getUriInfo($path)
|
|
|
{
|