for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Sendmail package.
*
* @author Peter Gribanov <[email protected]>
* @copyright Copyright (c) 2010, Peter Gribanov
* @license http://opensource.org/licenses/MIT MIT
*/
namespace Sendmail\Sender\Smtp;
* Dialogue exception.
class Exception extends \Exception
{
* @var Dialogue
protected $dialogue;
* @param Dialogue $dialogue
public function __construct(Dialogue $dialogue)
$this->dialogue = $dialogue;
$response = explode("\n", $dialogue->getLog());
$response = array_shift($response);
if (preg_match('/^(\d{3})(.+)/', $response, $match)) {
parent::__construct(trim($match[2]), (int) $match[1]);
} else {
parent::__construct(trim($response), 500);
}
* @return Dialogue
public function getDialogue()
return $this->dialogue;