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

[Mailer] Make sure Http TransportException is not leaking#42184

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

Merged

Conversation

@Nyholm
Copy link
Member

@NyholmNyholm commentedJul 19, 2021
edited
Loading

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

We dont want the mailer to throw exceptions from the http-client component. This will make sure to catch such exceptions and rethrow the proper HttpTransportException from the Mailer component.

@carsonbotcarsonbot added this to the5.2 milestoneJul 19, 2021
@NyholmNyholmforce-pushed themailer-http-transport-exception branch from82a061e tof888d56CompareJuly 19, 2021 00:40
@OskarStark
Copy link
Contributor

One minor question, why not against4.4?

Nyholm reacted with thumbs up emoji

thrownewHttpTransportException('Could not reach the remote Mailgun server.',$response,0,$e);
}

if (200 !==$response->getStatusCode()) {

Choose a reason for hiding this comment

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

I'd wrap the call togetStatusCode andtoArray in the same try/catch (same everywhere)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Sure. I will but why? This will never throwTransportExceptionInterface if I first get the body.

Choose a reason for hiding this comment

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

I'd say to make things easy to reason about and consistent (some places were calling getStatusCode before toArray/getContent)

@NyholmNyholmforce-pushed themailer-http-transport-exception branch fromf888d56 to1681bc1CompareJuly 19, 2021 21:26
@NyholmNyholm changed the base branch from5.2 to4.4July 19, 2021 21:26
@NyholmNyholm modified the milestones:5.2,4.4Jul 19, 2021
@Nyholm
Copy link
MemberAuthor

The PR is updated.

I've targeted 4.4 and made sure we get both status code and body inside the try/catch

OskarStark reacted with rocket emoji

@nicolas-grekas
Copy link
Member

Thank you@Nyholm.

@nicolas-grekasnicolas-grekas merged commit3413e23 intosymfony:4.4Jul 20, 2021
@NyholmNyholm deleted the mailer-http-transport-exception branchJuly 20, 2021 13:47
This was referencedJul 26, 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

@OskarStarkOskarStarkOskarStark approved these changes

@derrabusderrabusAwaiting requested review from derrabus

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

4 participants

@Nyholm@OskarStark@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp