Commit a78c2339 authored by Fabien Potencier's avatar Fabien Potencier

fixed HTTP exceptions to match the recent change upstream

parent 61e73beb
...@@ -294,10 +294,10 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe ...@@ -294,10 +294,10 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
$this['request']->attributes->add($attributes); $this['request']->attributes->add($attributes);
} catch (NotFoundException $e) { } catch (NotFoundException $e) {
$message = sprintf('No route found for "%s %s"', $this['request']->getMethod(), $this['request']->getPathInfo()); $message = sprintf('No route found for "%s %s"', $this['request']->getMethod(), $this['request']->getPathInfo());
throw new NotFoundHttpException('Not Found', $message, 0, $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)', $this['request']->getMethod(), $this['request']->getPathInfo(), strtoupper(implode(', ', $e->getAllowedMethods()))); $message = sprintf('No route found for "%s %s": Method Not Allowed (Allow: %s)', $this['request']->getMethod(), $this['request']->getPathInfo(), strtoupper(implode(', ', $e->getAllowedMethods())));
throw new MethodNotAllowedHttpException($e->getAllowedMethods(), 'Method Not Allowed', $message, 0, $e); throw new MethodNotAllowedHttpException($e->getAllowedMethods(), $message, $e);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment