コード例 #1
0
 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;
 }
コード例 #2
0
ファイル: PDOException.php プロジェクト: Nercury/dbal
 /**
  * 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();
 }
コード例 #3
0
ファイル: Exception.php プロジェクト: jiatower/php
 public function __construct($message, $code = 0)
 {
     if (is_a($message, 'Exception')) {
         parent::__construct($message, intval($message->getCode()));
     } else {
         parent::__construct($message, intval($code));
     }
 }
コード例 #4
0
ファイル: DBException.php プロジェクト: timesplinter/tsfw-db
 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;
 }
コード例 #5
0
ファイル: ExceptionG.php プロジェクト: gecoreto/gecobject2
 /**
  * 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();
 }
コード例 #6
0
ファイル: FlupdoException.php プロジェクト: smalldb/flupdo
 /**
  * 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;
 }
コード例 #7
0
 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];
         }
     }
 }
コード例 #8
0
 public function __construct($message = 'Unsupported functionality', $code = 0, Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
コード例 #9
0
 public function __construct($message = 'Invalid argument', $code = 0, Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
コード例 #10
0
 public function __construct($Message, $Code, PDOException $Exception, PDOStatementExtended $Stmt)
 {
     parent::__construct($Message, $Code);
     $this->Stmt = $Stmt;
 }
コード例 #11
0
ファイル: API_DB_Exception.php プロジェクト: hcv-target/redi
 public function __construct($error, $errorCode)
 {
     parent::__construct($error);
     $this->errorCode = $errorCode;
 }
コード例 #12
0
 public function __construct($message)
 {
     parent::__construct($message, 0);
 }
コード例 #13
0
ファイル: pdo.php プロジェクト: jpic/pdo-schemaless
 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));
 }