You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was squashed before being merged into the 6.2 branch.
Discussion
----------
[Mailer] [MailPace] Fix undefined array key in errors response
| Q | A
| ------------- | ---
| Branch? | 6.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | none
| License | MIT
| Doc PR | -
This PR fixes a bug which occurs when MailPace returns an `errors` response instead of `error` (see https://docs.mailpace.com/reference/responses/ for possible responses).
Without this fix, the `errors` response leads to the following exception: `ErrorException: Undefined array key "error"`
I added two tests to verify that:
- responses with multiple errors are returned as readable error message
- empty responses generate a readable error message
To fix the bug I added a check for the existence of the `error`/`errors` key in the `$result` variable and a fallback just in case that both are not present.
Commits
-------
38a7ee5 [Mailer] [MailPace] Fix undefined array key in errors response
$this->expectExceptionMessage('Unable to send an email: to: contains a blocked address & number of email addresses exceeds maximum volume; attachments.name: Extension file type blocked, see Docs for full list of allowed file types (code 400).');
0 commit comments