Symfony Exception

NotFoundHttpException

HTTP 404 Not Found

Exception

Symfony\Component\HttpKernel\Exception\ NotFoundHttpException

  1.      * @throws \Symfony\Component\HttpKernel\Exception\HttpException
  2.      */
  3.     public function abort($code$message '', array $headers = [])
  4.     {
  5.         if ($code == 404) {
  6.             throw new NotFoundHttpException($message);
  7.         }
  8.         throw new HttpException($code$messagenull$headers);
  9.     }
  1.      * @throws \Symfony\Component\HttpKernel\Exception\HttpException
  2.      * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
  3.      */
  4.     function abort($code$message '', array $headers = [])
  5.     {
  6.         app()->abort($code$message$headers);
  7.     }
  8. }
  9. if (! function_exists('app')) {
  10.     /**
  1.         $urlPath explode('/'$this->request->path());
  2.         // 获取城市code
  3.         $this->cityCode $this->request->route('cityCode');
  4.         if (isset($this->cityCode) && $this->cityCode != 'sh'abort(404); 
  5.         $this->cityCode 'sh';
  6.         $this->cityID 1;
  7.         view()->share('cityCode'$this->cityCode);
  1.     /**
  2.      * 初始化
  3.      */
  4.     public function __construct()
  5.     {
  6.         parent::__construct();
  7.         $this->_news = new NewsModel();
  8.     }
  9.     // 城市首页
HomeController->__construct()
  1.             throw $e;
  2.         }
  3.         array_pop($this->buildStack);
  4.         return $reflector->newInstanceArgs($instances);
  5.     }
  6.     /**
  7.      * Resolve all of the dependencies from the ReflectionParameters.
  8.      *
  1.         // We're ready to instantiate an instance of the concrete type registered for
  2.         // the binding. This will instantiate the types, as well as resolve any of
  3.         // its "nested" dependencies recursively until all have gotten resolved.
  4.         if ($this->isBuildable($concrete$abstract)) {
  5.             $object $this->build($concrete);
  6.         } else {
  7.             $object $this->make($concrete);
  8.         }
  9.         // If we defined any extenders for this type, we'll need to spin through them
  1.      *
  2.      * @throws \Illuminate\Contracts\Container\BindingResolutionException
  3.      */
  4.     public function make($abstract, array $parameters = [])
  5.     {
  6.         return $this->resolve($abstract$parameters);
  7.     }
  8.     /**
  9.      * {@inheritdoc}
  10.      *
  1.             $this->{$method $this->availableBindings[$abstract]}();
  2.             $this->ranServiceBinders[$method] = true;
  3.         }
  4.         return parent::make($abstract$parameters);
  5.     }
  6.     /**
  7.      * Register container bindings for the application.
  8.      *
  1.             $uses .= '@__invoke';
  2.         }
  3.         [$controller$method] = explode('@'$uses);
  4.         if (! method_exists($instance $this->make($controller), $method)) {
  5.             throw new NotFoundHttpException;
  6.         }
  7.         if ($instance instanceof LumenController) {
  8.             return $this->callLumenController($instance$method$routeInfo);
  1.     protected function callActionOnArrayBasedRoute($routeInfo)
  2.     {
  3.         $action $routeInfo[1];
  4.         if (isset($action['uses'])) {
  5.             return $this->prepareResponse($this->callControllerAction($routeInfo));
  6.         }
  7.         foreach ($action as $value) {
  8.             if ($value instanceof Closure) {
  9.                 $callable $value->bindTo(new RoutingClosure);
  1.                 return $this->callActionOnArrayBasedRoute($this['request']->route());
  2.             }));
  3.         }
  4.         return $this->prepareResponse(
  5.             $this->callActionOnArrayBasedRoute($routeInfo)
  6.         );
  7.     }
  8.     /**
  9.      * Call the Closure or invokable on the array based route.
  1.             case Dispatcher::NOT_FOUND:
  2.                 throw new NotFoundHttpException;
  3.             case Dispatcher::METHOD_NOT_ALLOWED:
  4.                 throw new MethodNotAllowedHttpException($routeInfo[1]);
  5.             case Dispatcher::FOUND:
  6.                 return $this->handleFoundRoute($routeInfo);
  7.         }
  8.     }
  9.     /**
  10.      * Handle a route found by the dispatcher.
  1.                 if (isset($this->router->getRoutes()[$method.$pathInfo])) {
  2.                     return $this->handleFoundRoute([true$this->router->getRoutes()[$method.$pathInfo]['action'], []]);
  3.                 }
  4.                 return $this->handleDispatcherResponse(
  5.                     $this->createDispatcher()->dispatch($method$pathInfo)
  6.                 );
  7.             });
  8.         } catch (Throwable $e) {
  9.             return $this->prepareResponse($this->sendExceptionToHandler($e));
  10.         }
  1.      */
  2.     protected function prepareDestination(BaseClosure $destination)
  3.     {
  4.         return function ($passable) use ($destination) {
  5.             try {
  6.                 return $destination($passable);
  7.             } catch (Throwable $e) {
  8.                 return $this->handleException($passable$e);
  9.             }
  10.         };
  11.     }
  1.             $this->startSession($request$session)
  2.         );
  3.         $this->collectGarbage($session);
  4.         $response $next($request);
  5.         $this->storeCurrentUrl($request$session);
  6.         $this->addCookieToResponse($response$session);
  1.         if ($this->manager->shouldBlock() ||
  2.             ($request->route() instanceof Route && $request->route()->locksFor())) {
  3.             return $this->handleRequestWhileBlocking($request$session$next);
  4.         }
  5.         return $this->handleStatefulRequest($request$session$next);
  6.     }
  7.     /**
  8.      * Handle the given request within session state.
  9.      *
  1.                         // since the object we're given was already a fully instantiated object.
  2.                         $parameters = [$passable$stack];
  3.                     }
  4.                     $carry method_exists($pipe$this->method)
  5.                                     ? $pipe->{$this->method}(...$parameters)
  6.                                     : $pipe(...$parameters);
  7.                     return $this->handleCarry($carry);
  8.                 } catch (Throwable $e) {
  9.                     return $this->handleException($passable$e);
  1.         return function ($stack$pipe) {
  2.             return function ($passable) use ($stack$pipe) {
  3.                 try {
  4.                     $slice parent::carry();
  5.                     return ($slice($stack$pipe))($passable);
  6.                 } catch (Throwable $e) {
  7.                     return $this->handleException($passable$e);
  8.                 }
  9.             };
  10.         };
in /data/wwwroot/hsz/hsz-web-php/vendor/illuminate/pipeline/Pipeline.php -> Laravel\Lumen\Routing\{closure} (line 103)
  1.     {
  2.         $pipeline array_reduce(
  3.             array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
  4.         );
  5.         return $pipeline($this->passable);
  6.     }
  7.     /**
  8.      * Run the pipeline and return the result.
  9.      *
  1.     {
  2.         if (count($middleware) > && ! $this->shouldSkipMiddleware()) {
  3.             return (new Pipeline($this))
  4.                 ->send($this->make('request'))
  5.                 ->through($middleware)
  6.                 ->then($then);
  7.         }
  8.         return $then($this->make('request'));
  9.     }
  1.                 }
  2.                 return $this->handleDispatcherResponse(
  3.                     $this->createDispatcher()->dispatch($method$pathInfo)
  4.                 );
  5.             });
  6.         } catch (Throwable $e) {
  7.             return $this->prepareResponse($this->sendExceptionToHandler($e));
  8.         }
  9.     }
  1.      * @param  \Symfony\Component\HttpFoundation\Request|null  $request
  2.      * @return void
  3.      */
  4.     public function run($request null)
  5.     {
  6.         $response $this->dispatch($request);
  7.         if ($response instanceof SymfonyResponse) {
  8.             $response->send();
  9.         } else {
  10.             echo (string) $response;
Application->run() in /data/wwwroot/hsz/hsz-web-php/public/index.php (line 28)
  1. | the client's browser allowing them to enjoy the creative
  2. | and wonderful application we have prepared for them.
  3. |
  4. */
  5. $app->run();

Stack Trace

NotFoundHttpException
Symfony\Component\HttpKernel\Exception\NotFoundHttpException:

  at /data/wwwroot/hsz/hsz-web-php/vendor/laravel/lumen-framework/src/Concerns/RegistersExceptionHandlers.php:31
  at Laravel\Lumen\Application->abort()
     (/data/wwwroot/hsz/hsz-web-php/vendor/laravel/lumen-framework/src/helpers.php:24)
  at abort()
     (/data/wwwroot/hsz/hsz-web-php/app/Http/Controllers/Controller.php:46)
  at App\Http\Controllers\Controller->__construct()
     (/data/wwwroot/hsz/hsz-web-php/app/Http/Controllers/Cn/HomeController.php:16)
  at App\Http\Controllers\Cn\HomeController->__construct()
  at ReflectionClass->newInstanceArgs()
     (/data/wwwroot/hsz/hsz-web-php/vendor/illuminate/container/Container.php:917)
  at Illuminate\Container\Container->build()
     (/data/wwwroot/hsz/hsz-web-php/vendor/illuminate/container/Container.php:758)
  at Illuminate\Container\Container->resolve()
     (/data/wwwroot/hsz/hsz-web-php/vendor/illuminate/container/Container.php:694)
  at Illuminate\Container\Container->make()
     (/data/wwwroot/hsz/hsz-web-php/vendor/laravel/lumen-framework/src/Application.php:300)
  at Laravel\Lumen\Application->make()
     (/data/wwwroot/hsz/hsz-web-php/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:324)
  at Laravel\Lumen\Application->callControllerAction()
     (/data/wwwroot/hsz/hsz-web-php/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:282)
  at Laravel\Lumen\Application->callActionOnArrayBasedRoute()
     (/data/wwwroot/hsz/hsz-web-php/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:267)
  at Laravel\Lumen\Application->handleFoundRoute()
     (/data/wwwroot/hsz/hsz-web-php/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:237)
  at Laravel\Lumen\Application->handleDispatcherResponse()
     (/data/wwwroot/hsz/hsz-web-php/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:173)
  at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}()
     (/data/wwwroot/hsz/hsz-web-php/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:48)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/data/wwwroot/hsz/hsz-web-php/vendor/illuminate/session/Middleware/StartSession.php:121)
  at Illuminate\Session\Middleware\StartSession->handleStatefulRequest()
     (/data/wwwroot/hsz/hsz-web-php/vendor/illuminate/session/Middleware/StartSession.php:64)
  at Illuminate\Session\Middleware\StartSession->handle()
     (/data/wwwroot/hsz/hsz-web-php/vendor/illuminate/pipeline/Pipeline.php:167)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/data/wwwroot/hsz/hsz-web-php/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30)
  at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}()
     (/data/wwwroot/hsz/hsz-web-php/vendor/illuminate/pipeline/Pipeline.php:103)
  at Illuminate\Pipeline\Pipeline->then()
     (/data/wwwroot/hsz/hsz-web-php/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:426)
  at Laravel\Lumen\Application->sendThroughPipeline()
     (/data/wwwroot/hsz/hsz-web-php/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:175)
  at Laravel\Lumen\Application->dispatch()
     (/data/wwwroot/hsz/hsz-web-php/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112)
  at Laravel\Lumen\Application->run()
     (/data/wwwroot/hsz/hsz-web-php/public/index.php:28)