public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)
    {
        while ($route = $this->router->route($request)) {
            $module     = $route->getPayload()['module'];
            $controller = $route->getPayload()['controller'];
            $action     = $route->getPayload()['action'];
            $class      = str_replace(
                ['{:module}', '{:controller}'],
                [$module, $controller],
                $this->mapping
            );
            try {
                return $this->assetManager->resolve($class, ['invoke' => $action]);
            } catch (\LogicException $e) {
                $this->failures[] = ['route' => $route, 'exception' => $e];
            }
        }
    }