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

Appearance settings

Commit 517ceae

Browse filesBrowse files
committed
Handle Brevo error responses without a message key
1 parent abe5555 commit 517ceae
Copy full SHA for 517ceae

File tree

Expand file treeCollapse file tree

2 files changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-2
lines changed

‎src/Symfony/Component/Mailer/Bridge/Brevo/Transport/BrevoApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Brevo/Transport/BrevoApiTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $e
6565
}
6666

6767
if (201 !== $statusCode) {
68-
throw new HttpTransportException('Unable to send an email: '.$result['message'].sprintf(' (code %d).', $statusCode), $response);
68+
throw new HttpTransportException('Unable to send an email: '.($result['message'] ?? $response->getContent(false)).sprintf(' (code %d).', $statusCode), $response);
6969
}
7070

7171
$sentMessage->setMessageId($result['messageId']);

‎src/Symfony/Component/Notifier/Bridge/Brevo/BrevoTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Notifier/Bridge/Brevo/BrevoTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ protected function doSend(MessageInterface $message): SentMessage
7575
if (201 !== $statusCode) {
7676
$error = $response->toArray(false);
7777

78-
throw new TransportException('Unable to send the SMS: '.$error['message'], $response);
78+
throw new TransportException('Unable to send the SMS: '.($error['message'] ?? $response->getContent(false)), $response);
7979
}
8080

8181
$success = $response->toArray(false);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.