Exception
API reference › yii › db › Exception
2 subclasses
Exception represents an exception that is caused by some DB-related operations.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$errorInfo | array | The error info provided by a PDO exception. Default: []. | Exception |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Constructor. | Exception |
__toString() | Exception | |
getName() | Exception |
Property details
Section titled “Property details”$errorInfo
Section titled “$errorInfo ”public array $errorInfo = []The error info provided by a PDO exception.
This is the same as returned by PDO::errorInfo.
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(string $message, array $errorInfo = [], string $code = '', Throwable|null $previous = null)Constructor.
Parameters
| Parameter | Type | Description |
|---|---|---|
$message | string | PDO error message |
$errorInfo | array | PDO error info |
$code | string | PDO error code |
$previous | Throwable| | The previous exception used for the exception chaining. |
__toString()
Section titled “__toString() ”public function __toString(): stringReturns
string: Readable representation of exception
getName()
Section titled “getName() ”public function getName(): stringReturns
string: The user-friendly name of this exception