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

[Notifier][Sendinblue] Handle error responses without a message key#52095

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
nicolas-grekas merged 1 commit intosymfony:5.4fromstof:sendinblue_error_response
Oct 17, 2023

Conversation

@stof
Copy link
Member

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets
LicenseMIT

During their outage yesterday where the endpoint returned errors with status code 500, there was nomessage key in the json response.
This avoids a notice when the key does not exist. Instead, it uses the full response content, as done when the decoding fails.


if (201 !==$statusCode) {
thrownewHttpTransportException('Unable to send an email:'.$result['message'].sprintf(' (code %d).',$statusCode),$response);
thrownewHttpTransportException('Unable to send an email:'.($error['message'] ??$response->getContent(false)).sprintf(' (code %d).',$statusCode),$response);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
thrownewHttpTransportException('Unable to send an email:'.($error['message'] ??$response->getContent(false)).sprintf(' (code %d).',$statusCode),$response);
thrownewHttpTransportException('Unable to send an email:'.($result['message'] ??$response->getContent(false)).sprintf(' (code %d).',$statusCode),$response);

@OskarStark
Copy link
Contributor

OskarStark commentedOct 17, 2023
edited
Loading

As Brevo is the 1:1 replacement for Sendinblue after their rebranding, can you please also update Mailer/Brevo and Notifier/Brevo bridges? Thanks

@stof
Copy link
MemberAuthor

@OskarStark done in#52096 as the Brevo transports only exist in the 6.4 branch, not in 5.4

OskarStark reacted with thumbs up emoji

@stofstofforce-pushed thesendinblue_error_response branch froma9fb5e5 to8ae8993CompareOctober 17, 2023 08:47
@carsonbotcarsonbot changed the titleHandle Sendinblue error responses without a message key[Notifier] Handle Sendinblue error responses without a message keyOct 17, 2023
@OskarStarkOskarStark changed the title[Notifier] Handle Sendinblue error responses without a message key[Notifier][Sendinblue] Handle error responses without a message keyOct 17, 2023
@nicolas-grekas
Copy link
Member

Thank you@stof.

@nicolas-grekasnicolas-grekas merged commit754e482 intosymfony:5.4Oct 17, 2023
@stofstof deleted the sendinblue_error_response branchOctober 17, 2023 10:05
nicolas-grekas added a commit that referenced this pull requestOct 17, 2023
…e key (stof)This PR was merged into the 6.4 branch.Discussion----------[Notifier] [Brevo] Handle error responses without a message key| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       || License       | MITDuring their outage yesterday where the endpoint returned errors with status code 500, there was no message key in the json response.This avoids a notice when the key does not exist. Instead, it uses the full response content, as done when the decoding fails.This is the same change than#52095 but for the new Brevo bridgeCommits-------517ceae Handle Brevo error responses without a message key
symfony-splitter pushed a commit to symfony/brevo-notifier that referenced this pull requestOct 17, 2023
…e key (stof)This PR was merged into the 6.4 branch.Discussion----------[Notifier] [Brevo] Handle error responses without a message key| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       || License       | MITDuring their outage yesterday where the endpoint returned errors with status code 500, there was no message key in the json response.This avoids a notice when the key does not exist. Instead, it uses the full response content, as done when the decoding fails.This is the same change thansymfony/symfony#52095 but for the new Brevo bridgeCommits-------517ceaea03 Handle Brevo error responses without a message key
symfony-splitter pushed a commit to symfony/brevo-mailer that referenced this pull requestOct 17, 2023
…e key (stof)This PR was merged into the 6.4 branch.Discussion----------[Notifier] [Brevo] Handle error responses without a message key| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       || License       | MITDuring their outage yesterday where the endpoint returned errors with status code 500, there was no message key in the json response.This avoids a notice when the key does not exist. Instead, it uses the full response content, as done when the decoding fails.This is the same change thansymfony/symfony#52095 but for the new Brevo bridgeCommits-------517ceaea03 Handle Brevo error responses without a message key
@fabpotfabpot mentioned this pull requestOct 21, 2023
@fabpotfabpot mentioned this pull requestOct 29, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

4 participants

@stof@OskarStark@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp