8000 add ability to configure catching exceptions · Basster/symfony@4812e60 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4812e60

Browse files
committed
add ability to configure catching exceptions
1 parent bc84304 commit 4812e60

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/Symfony/Component/HttpKernel/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ CHANGELOG
1111
* added `AddCacheClearerPass`
1212
* added `AddCacheWarmerPass`
1313
* deprecated `EnvParametersResource`
14+
* added `Symfony\Component\HttpKernel\Client::catchExceptions()`
1415

1516
3.3.0
1617
-----

src/Symfony/Component/HttpKernel/Client.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
class Client extends BaseClient
3232
{
3333
protected $kernel;
34+
private $catchExceptions = true;
3435

3536
/**
3637
* Constructor.
@@ -49,6 +50,16 @@ public function __construct(HttpKernelInterface $kernel, array $server = array()
4950
parent::__construct($server, $history, $cookieJar);
5051
}
5152

53+
/**
54+
* Sets whether to catch exceptions when the kernel is handling a request.
55+
*
56+
* @param bool $catchExceptions Whether to catch exceptions
57+
*/
58+
public function catchExceptions($catchExceptions)
59+
{
60+
$this->catchExceptions = $catchExceptions;
61+
}
62+
5263
/**
5364
* Makes a request.
5465
*
@@ -58,7 +69,7 @@ public function __construct(HttpKernelInterface $kernel, array $server = array()
5869
*/
5970
protected function doRequest($request)
6071
{
61-
$response = $this->kernel->handle($request);
72+
$response = $this->kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, $this->catchExceptions);
6273

6374
if ($this->kernel instanceof TerminableInterface) {
6475
$this->kernel->terminate($request, $response);

0 commit comments

Comments
 (0)
0