[Mailer] added debug info to TransportExceptionInterface
This commit is contained in:
parent
253d6f52ab
commit
39ebb84602
@ -16,4 +16,15 @@ namespace Symfony\Component\Mailer\Exception;
|
||||
*/
|
||||
class TransportException extends RuntimeException implements TransportExceptionInterface
|
||||
{
|
||||
private $debug = '';
|
||||
|
||||
public function getDebug(): string
|
||||
{
|
||||
return $this->debug;
|
||||
}
|
||||
|
||||
public function appendDebug(string $debug): void
|
||||
{
|
||||
$this->debug .= $debug;
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,7 @@ namespace Symfony\Component\Mailer\Exception;
|
||||
*/
|
||||
interface TransportExceptionInterface extends ExceptionInterface
|
||||
{
|
||||
public function getDebug(): string;
|
||||
|
||||
public function appendDebug(string $debug): void;
|
||||
}
|
||||
|
@ -157,8 +157,11 @@ class SmtpTransport extends AbstractTransport
|
||||
}
|
||||
$this->stream->flush();
|
||||
$this->executeCommand("\r\n.\r\n", [250]);
|
||||
} finally {
|
||||
$message->appendDebug($this->stream->getDebug());
|
||||
} catch (TransportExceptionInterface $e) {
|
||||
$e->appendDebug($this->stream->getDebug());
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user