-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Add ability to configure catching exceptions for Client #22890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
new features should be submitted against 3.4 |
@@ -31,6 +31,7 @@ | ||
class Client extends BaseClient | ||
{ | ||
protected $kernel; | ||
protected $catchExceptions = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be private
* | ||
* @param bool $catchExceptions Whether to catch exceptions | ||
*/ | ||
public function catchExceptions($catchExceptions = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having a default value here does not very useful to me
Anything preventing this from making it into 3.4? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing CHANGELOG.md entry ? :)
* | ||
* @return bool | ||
*/ | ||
public function isCatchingExceptions() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this method really useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, I was just matching Symfony\Component\BrowserKit\Client::isFollowingRedirects()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I added a Let me know if you want me to remove |
Thank you @kbond. |
…ons for Client (kbond) This PR was merged into the 3.4 branch. Discussion ---------- [HttpKernel] Add ability to configure catching exceptions for Client | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | todo Debugging exceptions in functional tests is difficult as you need to look at the logs to see which exception was thrown. Disabling catching of exceptions in the client would allow the exception to bubble up to phpunit and make it easier to see what exception was thrown. Commits ------- 4812e60 add ability to configure catching exceptions
…anged browser kit client to not catch exceptions to fix our test suite. References: - https://symfony.com/blog/new-in-symfony-4-1-deprecated-the-bundle-notation - symfony/symfony#26085 - symfony/symfony#22890 Signed-off-by: Rob Frawley 2nd <rmf@src.run>
Debugging exceptions in functional tests is difficult as you need to look at the logs to see which exception was thrown. Disabling catching of exceptions in the client would allow the exception to bubble up to phpunit and make it easier to see what exception was thrown.