public function __construct($errorInfo) { $sqlState = isset($errorInfo[0]) ? $errorInfo[0] : '-'; $driverMessage = isset($errorInfo[2]) ? $errorInfo[2] : 'Unknown'; parent::__construct("{$sqlState} {$driverMessage}", 0); $this->code = $sqlState; $this->errorInfo = $errorInfo; }
/** * Constructor. * * @param \PDOException $exception The PDO exception to wrap. */ public function __construct(\PDOException $exception) { parent::__construct($exception->getMessage(), 0, $exception->getPrevious()); $this->code = $exception->getCode(); $this->errorInfo = $exception->errorInfo; $this->errorCode = isset($exception->errorInfo[1]) ? $exception->errorInfo[1] : $exception->getCode(); $this->sqlState = isset($exception->errorInfo[0]) ? $exception->errorInfo[0] : $exception->getCode(); }
public function __construct($message, $code = 0) { if (is_a($message, 'Exception')) { parent::__construct($message, intval($message->getCode())); } else { parent::__construct($message, intval($code)); } }
public function __construct(\PDOException $e, $queryString = null, $queryParams = null) { parent::__construct($e->getMessage(), 0, $e); $this->code = $e->getCode(); $this->errorInfo = $e->errorInfo; $this->queryString = $queryString; $this->queryParams = $queryParams; }
/** * Constructor inicializa los atributos de la clase * @param string $message Mensaje de la exception lanzada * @param integer $code Codigo de error generado en la consulta Mysql */ public function __construct($message = null, $code, $config) { parent::__construct($message, (int) $code); $this->message = $message; $this->code = $code; $this->config = $config; // $this->changemessage(); $this->log(); }
/** * Constructor. */ function __construct($message = "", $code = 0, $previous = null, $query_sql = null, $query_params = null) { parent::__construct($message, null, $previous); $this->code = $code; // PDOException has non-numeric code, we need to avoid check in \Exception::__construct if ($previous) { $this->errorInfo = $previous->errorInfo; } $this->query_sql = (string) $query_sql; $this->query_params = (array) $query_params; }
public function __construct($message = "", $code = 0, PDOException $e = null) { if (is_subclass_of($message, 'PDOException')) { $e = $message; $code = $e->getCode(); $message = $e->getMessage(); } parent::__construct($message, $code, $e); $state = $this->getMessage(); if (!strstr($state, 'SQLSTATE[')) { $state = $this->getCode(); } if (strstr($state, 'SQLSTATE[')) { preg_match('/SQLSTATE\\[(\\w+)\\] \\[(\\w+)\\] (.*)/', $state, $matches); if (sizeof($matches) > 0) { $this->code = $matches[1] == 'HT000' ? $matches[2] : $matches[1]; $this->message = $matches[3]; } } }
public function __construct($message = 'Unsupported functionality', $code = 0, Exception $previous = null) { parent::__construct($message, $code, $previous); }
public function __construct($message = 'Invalid argument', $code = 0, Exception $previous = null) { parent::__construct($message, $code, $previous); }
public function __construct($Message, $Code, PDOException $Exception, PDOStatementExtended $Stmt) { parent::__construct($Message, $Code); $this->Stmt = $Stmt; }
public function __construct($error, $errorCode) { parent::__construct($error); $this->errorCode = $errorCode; }
public function __construct($message) { parent::__construct($message, 0); }
public function __construct(PDOException $e, PDOStatement $s) { $this->e = $e; $this->s = $s; parent::__construct(sprintf("Query failure: %s Query: ", $this->e->getMessage(), $this->s->queryString)); }