/** * @param Throwable|Exception $e */ public function __construct($e) { // PDOException::getCode() is a string. // @see http://php.net/manual/en/class.pdoexception.php#95812 parent::__construct($e->getMessage(), (int) $e->getCode()); $this->classname = get_class($e); $this->file = $e->getFile(); $this->line = $e->getLine(); $this->serializableTrace = $e->getTrace(); foreach ($this->serializableTrace as $i => $call) { unset($this->serializableTrace[$i]['args']); } if ($e->getPrevious()) { $this->previous = new self($e->getPrevious()); } }
/** * Constructor. * * @param string $message * @param int $code * @param string $file * @param int $line * @param Exception $previous */ public function __construct($message, $code, $file, $line, Exception $previous = null) { parent::__construct($message, $code, $previous); $this->file = $file; $this->line = $line; }
public function __construct($message) { parent::__construct($message); }
/** * Make the exception message more informative. * @param $e Exception * @param $testObject string * @return Exception */ protected function improveException($e, $testObject) { $improvedMessage = "Error while testing {$testObject}: " . $e->getMessage(); if (is_a($e, 'PHPUnit_Framework_ExpectationFailedException')) { $e = new PHPUnit_Framework_ExpectationFailedException($improvedMessage, $e->getComparisonFailure()); } elseif (is_a($e, 'PHPUnit_Framework_Exception')) { $e = new PHPUnit_Framework_Exception($improvedMessage, $e->getCode()); } return $e; }
public function __construct($message = '', $code = 0, \Exception $previous = null) { $previous = $previous; parent::__construct($message, $code, $previous); }