diff --git a/src/Symfony/Component/HttpKernel/CHANGELOG.md b/src/Symfony/Component/HttpKernel/CHANGELOG.md index 8732b17dd83f5..66e3b38e25ce6 100644 --- a/src/Symfony/Component/HttpKernel/CHANGELOG.md +++ b/src/Symfony/Component/HttpKernel/CHANGELOG.md @@ -11,6 +11,7 @@ CHANGELOG * added `AddCacheClearerPass` * added `AddCacheWarmerPass` * deprecated `EnvParametersResource` + * added `Symfony\Component\HttpKernel\Client::catchExceptions()` 3.3.0 ----- diff --git a/src/Symfony/Component/HttpKernel/Client.php b/src/Symfony/Component/HttpKernel/Client.php index 94f70cd6f7a02..4a86564c9f9f2 100644 --- a/src/Symfony/Component/HttpKernel/Client.php +++ b/src/Symfony/Component/HttpKernel/Client.php @@ -31,6 +31,7 @@ class Client extends BaseClient { protected $kernel; + private $catchExceptions = true; /** * Constructor. @@ -49,6 +50,16 @@ public function __construct(HttpKernelInterface $kernel, array $server = array() parent::__construct($server, $history, $cookieJar); } + /** + * Sets whether to catch exceptions when the kernel is handling a request. + * + * @param bool $catchExceptions Whether to catch exceptions + */ + public function catchExceptions($catchExceptions) + { + $this->catchExceptions = $catchExceptions; + } + /** * Makes a request. * @@ -58,7 +69,7 @@ public function __construct(HttpKernelInterface $kernel, array $server = array() */ protected function doRequest($request) { - $response = $this->kernel->handle($request); + $response = $this->kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, $this->catchExceptions); if ($this->kernel instanceof TerminableInterface) { $this->kernel->terminate($request, $response);
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: