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 9c3951e

Browse filesBrowse files
committed
[Mailer] Use %d instead of %s for error code in error messages
1 parent 8397eb7 commit 9c3951e
Copy full SHA for 9c3951e

File tree

Expand file treeCollapse file tree

8 files changed

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

8 files changed

+12
-12
lines changed

‎src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesApiTransport.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
$result = new \SimpleXMLElement($response->getContent(false));
6767
if (200 !== $response->getStatusCode()) {
68-
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %s).', $result->Error->Message, $result->Error->Code), $response);
68+
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %d).', $result->Error->Message, $result->Error->Code), $response);
6969
}
7070

7171
$property = $payload['Action'].'Result';

‎src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesHttpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesHttpTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function doSendHttp(SentMessage $message): ResponseInterface
6565

6666
$result = new \SimpleXMLElement($response->getContent(false));
6767
if (200 !== $response->getStatusCode()) {
68-
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %s).', $result->Error->Message, $result->Error->Code), $response);
68+
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %d).', $result->Error->Message, $result->Error->Code), $response);
6969
}
7070

7171
$message->setMessageId($result->SendRawEmailResult->MessageId);

‎src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillApiTransport.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $e
5151
$result = $response->toArray(false);
5252
if (200 !== $response->getStatusCode()) {
5353
if ('error' === ($result['status'] ?? false)) {
54-
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %s).', $result['message'], $result['code']), $response);
54+
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %d).', $result['message'], $result['code']), $response);
5555
}
5656

57-
throw new HttpTransportException(sprintf('Unable to send an email (code %s).', $result['code']), $response);
57+
throw new HttpTransportException(sprintf('Unable to send an email (code %d).', $result['code']), $response);
5858
}
5959

6060
$firstRecipient = reset($result);

‎src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillHttpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillHttpTransport.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ protected function doSendHttp(SentMessage $message): ResponseInterface
5858
$result = $response->toArray(false);
5959
if (200 !== $response->getStatusCode()) {
6060
if ('error' === ($result['status'] ?? false)) {
61-
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %s).', $result['message'], $result['code']), $response);
61+
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %d).', $result['message'], $result['code']), $response);
6262
}
6363

64-
throw new HttpTransportException(sprintf('Unable to send an email (code %s).', $result['code']), $response);
64+
throw new HttpTransportException(sprintf('Unable to send an email (code %d).', $result['code']), $response);
6565
}
6666

6767
$message->setMessageId($result[0]['_id']);

‎src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunApiTransport.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $e
6565
$result = $response->toArray(false);
6666
if (200 !== $response->getStatusCode()) {
6767
if ('application/json' === $response->getHeaders(false)['content-type'][0]) {
68-
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %s).', $result['message'], $response->getStatusCode()), $response);
68+
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %d).', $result['message'], $response->getStatusCode()), $response);
6969
}
7070

71-
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %s).', $response->getContent(false), $response->getStatusCode()), $response);
71+
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %d).', $response->getContent(false), $response->getStatusCode()), $response);
7272
}
7373

7474
$sentMessage->setMessageId($result['id']);

‎src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunHttpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunHttpTransport.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ protected function doSendHttp(SentMessage $message): ResponseInterface
6767
$result = $response->toArray(false);
6868
if (200 !== $response->getStatusCode()) {
6969
if ('application/json' === $response->getHeaders(false)['content-type'][0]) {
70-
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %s).', $result['message'], $response->getStatusCode()), $response);
70+
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %d).', $result['message'], $response->getStatusCode()), $response);
7171
}
7272

73-
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %s).', $response->getContent(false), $response->getStatusCode()), $response);
73+
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %d).', $response->getContent(false), $response->getStatusCode()), $response);
7474
}
7575

7676
$message->setMessageId($result['id']);

‎src/Symfony/Component/Mailer/Bridge/Postmark/Transport/PostmarkApiTransport.php

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

5555
$result = $response->toArray(false);
5656
if (200 !== $response->getStatusCode()) {
57-
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %s).', $result['Message'], $result['ErrorCode']), $response);
57+
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %d).', $result['Message'], $result['ErrorCode']), $response);
5858
}
5959

6060
$sentMessage->setMessageId($result['MessageID']);

‎src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridApiTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $e
5353
if (202 !== $response->getStatusCode()) {
5454
$errors = $response->toArray(false);
5555

56-
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %s).', implode('; ', array_column($errors['errors'], 'message')), $response->getStatusCode()), $response);
56+
throw new HttpTransportException(sprintf('Unable to send an email: %s (code %d).', implode('; ', array_column($errors['errors'], 'message')), $response->getStatusCode()), $response);
5757
}
5858

5959
$sentMessage->setMessageId($response->getHeaders(false)['x-message-id'][0]);

0 commit comments

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