public function __construct(Throwable $t)
{
// PDOException::getCode() is a string.
// @see http://php.net/manual/en/class.pdoexception.php#95812
parent::__construct($t->getMessage(), (int) $t->getCode());
$this->classname = get_class($t);
$this->file = $t->getFile();
$this->line = $t->getLine();
$this->serializableTrace = $t->getTrace();
foreach ($this->serializableTrace as $i => $call) {
unset($this->serializableTrace[$i]['args']);
}
if ($t->getPrevious()) {
$this->previous = new self($t->getPrevious());
}
}