Exception.php 895 Bytes
Newer Older
w  
Qiang Xue committed
1 2
<?php
/**
w  
Qiang Xue committed
3
 * Exception class file.
w  
Qiang Xue committed
4 5
 *
 * @link http://www.yiiframework.com/
Qiang Xue committed
6
 * @copyright Copyright &copy; 2008 Yii Software LLC
w  
Qiang Xue committed
7 8 9
 * @license http://www.yiiframework.com/license/
 */

w  
Qiang Xue committed
10 11
namespace yii\db;

w  
Qiang Xue committed
12
/**
Qiang Xue committed
13
 * Exception represents an exception that is caused by some DB-related operations.
w  
Qiang Xue committed
14 15
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
w  
Qiang Xue committed
16
 * @since 2.0
w  
Qiang Xue committed
17
 */
w  
Qiang Xue committed
18
class Exception extends \yii\base\Exception
w  
Qiang Xue committed
19 20 21
{
	/**
	 * @var mixed the error info provided by a PDO exception. This is the same as returned
Qiang Xue committed
22
	 * by [PDO::errorInfo](http://www.php.net/manual/en/pdo.errorinfo.php).
w  
Qiang Xue committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
	 */
	public $errorInfo;

	/**
	 * Constructor.
	 * @param string $message PDO error message
	 * @param integer $code PDO error code
	 * @param mixed $errorInfo PDO error info
	 */
	public function __construct($message, $code = 0, $errorInfo = null)
	{
		$this->errorInfo = $errorInfo;
		parent::__construct($message, $code);
	}
}