Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpClient] Fix handling thrown \Exception in \Generator in MockResponse#44438

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@fancyweb
Copy link
Contributor

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

@carsonbotcarsonbot added this to the4.4 milestoneDec 3, 2021
@fancywebfancywebforce-pushed thehttp-client/fix-mock-response-throw-exception branch from810e8a6 to6ba7548CompareDecember 3, 2021 11:28
@fancyweb
Copy link
ContributorAuthor

Failure is related, I need to investigate.

@fancyweb
Copy link
ContributorAuthor

@nicolas-grekas The failure is related to the PHP version. It seems that the destructor ofErrorChunk is not triggered in the same way on 7.2 and above, I don't really know what should I do here. Keep the current behavior (direct throw) on 7.2? Modify the test so that it doesn't rely on the destructor? Something else?

@fancywebfancywebforce-pushed thehttp-client/fix-mock-response-throw-exception branch 4 times, most recently from3beaf09 tof2867f4CompareDecember 11, 2021 10:34
@fancywebfancywebforce-pushed thehttp-client/fix-mock-response-throw-exception branch fromf2867f4 toc71265bCompareDecember 11, 2021 11:03
$responses[] =newMockResponse($body, ['response_headers' =>$headers]);
$responses[] =newMockResponse($body, ['response_headers' =>$headers]);
$responses[] =newMockResponse((function () {thrownew \Exception('Fake connection timeout');yield''; })(), ['response_headers' =>$headers]);
$responses[] =newMockResponse((function () {yield''; })(), ['response_headers' =>$headers]);
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We don't need to throw for the test to be effective. Yielding after throwing "breaks" PHP 7.2.

@nicolas-grekas
Copy link
Member

Thank you@fancyweb.

@nicolas-grekasnicolas-grekas merged commit4b6e29d intosymfony:4.4Dec 11, 2021
@fancywebfancyweb deleted the http-client/fix-mock-response-throw-exception branchDecember 11, 2021 11:08
This was referencedDec 29, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

4 participants

@fancyweb@nicolas-grekas@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp