Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Mailer] Fix Error Handling for OhMySMTP Bridge#46603
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedJun 6, 2022
It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you. Cheers! Carsonbot |
| if (200 !==$statusCode) { | ||
| thrownewHttpTransportException('Unable to send an email:'.$result['Message'].sprintf(' (code %d).',$result['ErrorCode']),$response); | ||
| thrownewHttpTransportException('Unable to send an email:'.json_encode($result),$response); |
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 go with$response->getContent(false) instead
nicolas-grekas commentedJun 9, 2022
side note: please squash when pushing the change - or allow us to push on your fork if you prefer we squash on our side 🙏 |
paul-oms commentedJun 9, 2022
Thanks! That should cover it? :-) |
| if (200 !==$statusCode) { | ||
| thrownewHttpTransportException('Unable to send an email:'.$result['Message'].sprintf(' (code %d).',$result['ErrorCode']),$response); | ||
| thrownewHttpTransportException('Unable to send an email:'.$response->getContent(false),$response); |
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.
Can't we figure out all possibilities instead of "just" dumping the content?
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.
ok, that's the same on line 64, let's do it that way then.
fabpot commentedJun 9, 2022
Thank you@paul-oms. |
The OhMySMTP Bridge does not handle errors correctly, and throws up an
Undefined array key "Message"error when an API error is encountered (e.g. an invalid API key or Internal Server Error). This PR fixes this by showing the full error response.