*/
public function __construct($message, \PDOException $previous = null) {
\Exception::__construct($message, 0, $previous);
+
+ // we cannot use the constructor's parameter, because of (http://php.net/manual/en/exception.getcode.php):
+ // > Returns the exception code as integer in Exception but possibly as other type in Exception descendants (for example as string in PDOException).
+ if ($previous) $this->code = $previous->code;
}
}
* @inheritDoc
*/
public function __construct($message, $parameters, \PDOException $previous = null) {
- \Exception::__construct($message, 0, $previous);
+ parent::__construct($message, $previous);
$this->parameters = $parameters;
}