public function handle($path, $method = null)
    {
        try {
            $match = false;
            foreach ($this->routes as $route) {
                if ($route->match($path, $method)) {
                    $this->lastRoute = $route;
                    $match = true;
                    $results = $route->handle($path, $this->di);
                    if ($results) {
                        return $results;
                    }
                }
            }

            return $this->handleInternal("404", "No route could be matched by the router.");
        } catch (ForbiddenException $e) {
            return $this->handleInternal("403", $e->getMessage());
        } catch (NotFoundException $e) {
            return $this->handleInternal("404", $e->getMessage());
        } catch (InternalErrorException $e) {
            return $this->handleInternal("500", $e->getMessage());
        } catch (\Exception $e) {
            if ($this->mode === Router::DEVELOPMENT) {
                throw $e;
            }
            return $this->handleInternal("500", $e->getMessage());
        }
    }