Skip to content

Commit 0470ac3

Browse files
committed
bug #32899 [Mailer] fix wrong error message when connection closes unexpectedly (fabpot)
This PR was merged into the 4.3 branch. Discussion ---------- [Mailer] fix wrong error message when connection closes unexpectedly | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a When the initial connection to the SMTP is closed immediately by the server, the error is now more explicit. Commits ------- 887f27d [Mailer] fixed wrong error message when connection closes unexpectedly
2 parents e248345 + 887f27d commit 0470ac3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Symfony/Component/Mailer/Transport/Smtp/Stream/AbstractStream.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public function readLine(): string
7474
if ($metas['timed_out']) {
7575
throw new TransportException(sprintf('Connection to "%s" timed out.', $this->getReadConnectionDescription()));
7676
}
77+
if ($metas['eof']) {
78+
throw new TransportException(sprintf('Connection to "%s" has been closed unexpectedly.', $this->getReadConnectionDescription()));
79+
}
7780
}
7881

7982
return $line;

0 commit comments

Comments
 (0)