Exceptions
Exceptions 2
Symfony\Component\HttpKernel\Exception\ NotFoundHttpException
if ($referer = $request->headers->get('referer')) {
$message .= sprintf(' (from "%s")', $referer);
}
throw new NotFoundHttpException($message, $e);
} catch (MethodNotAllowedException $e) {
$message = sprintf('No route found for "%s %s": Method Not Allowed (Allow: %s)', $request->getMethod(), $request->getPathInfo(), implode(', ', $e->getAllowedMethods()));
throw new MethodNotAllowedHttpException($e->getAllowedMethods(), $message, $e);
}
private function handleRaw(Request $request, int $type = self::MASTER_REQUEST) {
$this->requestStack->push($request);
// request
$event = new GetResponseEvent($this, $request, $type);
$this->dispatcher->dispatch(KernelEvents::REQUEST, $event);
if ($event->hasResponse()) {
return $this->filterResponse($event->getResponse(), $request, $type);
}
*/
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) {
$request->headers->set('X-Php-Ob-Level', ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
// // LG 20220802 pour tests
// if (file_exists("/home/luc/partage_win10/Poubelle/")) {
// $jsonfile = "/home/luc/partage_win10/Poubelle/comparePasswords.txt";
// } else if (file_exists("/var/www/html/PAA/Recette/var/log/")) {
Symfony\Component\Routing\Exception\ ResourceNotFoundException
try {
// matching a request is more powerful than matching a URL path + context, so try that first
if ($this->matcher instanceof RequestMatcherInterface) {
$parameters = $this->matcher->matchRequest($request);
} else {
$parameters = $this->matcher->match($request->getPathInfo());
}
if (null !== $this->logger) {
$this->logger->info('Matched route "{route}".', [
'route' => isset($parameters['_route']) ? $parameters['_route'] : 'n/a',
private function handleRaw(Request $request, int $type = self::MASTER_REQUEST) {
$this->requestStack->push($request);
// request
$event = new GetResponseEvent($this, $request, $type);
$this->dispatcher->dispatch(KernelEvents::REQUEST, $event);
if ($event->hasResponse()) {
return $this->filterResponse($event->getResponse(), $request, $type);
}
*/
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) {
$request->headers->set('X-Php-Ob-Level', ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
// // LG 20220802 pour tests
// if (file_exists("/home/luc/partage_win10/Poubelle/")) {
// $jsonfile = "/home/luc/partage_win10/Poubelle/comparePasswords.txt";
// } else if (file_exists("/var/www/html/PAA/Recette/var/log/")) {
Stack Traces 2
[2/2] NotFoundHttpException |
---|
Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "POST /classes/Login.php" at vendor/symfony/http-kernel/EventListener/RouterListener.php:135 at Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest() (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:108) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() (vendor/symfony/event-dispatcher/EventDispatcher.php:203) at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() (vendor/symfony/event-dispatcher/EventDispatcher.php:43) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:135) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (vendor/symfony/http-kernel/HttpKernel.php:121) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:65) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:190) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:28) |
[1/2] ResourceNotFoundException |
---|
Symfony\Component\Routing\Exception\ResourceNotFoundException: No routes found for "/classes/Login.php". at vendor/symfony/routing/Matcher/Dumper/PhpMatcherTrait.php:70 at srcApp_KernelDevDebugContainerUrlMatcher->match() (vendor/symfony/routing/Router.php:247) at Symfony\Component\Routing\Router->match() (src/Service/RouterDecorator.php:120) at App\Service\RouterDecorator->match() (vendor/symfony/http-kernel/EventListener/RouterListener.php:113) at Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest() (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:108) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() (vendor/symfony/event-dispatcher/EventDispatcher.php:203) at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() (vendor/symfony/event-dispatcher/EventDispatcher.php:43) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:135) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (vendor/symfony/http-kernel/HttpKernel.php:121) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:65) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:190) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:28) |