|
@@ -109,15 +109,11 @@ class RequestListener
|
|
$request->attributes->add($parameters);
|
|
$request->attributes->add($parameters);
|
|
} catch (ResourceNotFoundException $e) {
|
|
} catch (ResourceNotFoundException $e) {
|
|
$message = sprintf('No route found for "%s %s"', $request->getMethod(), $request->getPathInfo());
|
|
$message = sprintf('No route found for "%s %s"', $request->getMethod(), $request->getPathInfo());
|
|
- if (null !== $this->logger) {
|
|
|
|
- $this->logger->err($message);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
throw new NotFoundHttpException($message, $e);
|
|
throw new NotFoundHttpException($message, $e);
|
|
} catch (MethodNotAllowedException $e) {
|
|
} catch (MethodNotAllowedException $e) {
|
|
$message = sprintf('No route found for "%s %s": Method Not Allowed (Allow: %s)', $request->getMethod(), $request->getPathInfo(), strtoupper(implode(', ', $e->getAllowedMethods())));
|
|
$message = sprintf('No route found for "%s %s": Method Not Allowed (Allow: %s)', $request->getMethod(), $request->getPathInfo(), strtoupper(implode(', ', $e->getAllowedMethods())));
|
|
- if (null !== $this->logger) {
|
|
|
|
- $this->logger->err($message);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
throw new MethodNotAllowedHttpException($e->getAllowedMethods(), $message, $e);
|
|
throw new MethodNotAllowedHttpException($e->getAllowedMethods(), $message, $e);
|
|
}
|
|
}
|
|
|
|
|