Class Yiisoft\Db\Exception\Exception
Represents an exception that's caused by some DB-related operations.
It provides more information about the error that's caused by the exception.
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $errorInfo | array|null | Yiisoft\Db\Exception\Exception |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Db\Exception\Exception | |
| __toString() | Yiisoft\Db\Exception\Exception |
Property Details
Method Details
| public mixed __construct ( string $message, array|null $errorInfo = [], Exception|null $previous = null ) | ||
| $message | string | |
| $errorInfo | array|null | |
| $previous | Exception|null | |
public function __construct(string $message, public ?array $errorInfo = [], ?\Exception $previous = null)
{
parent::__construct($message, 0, $previous);
}
| public string __toString ( ) | ||
| return | string |
Readable representation of exception. |
|---|---|---|
public function __toString(): string
{
return parent::__toString() . PHP_EOL . 'Additional Information:' . PHP_EOL . print_r($this->errorInfo, true);
}
Signup or Login in order to comment.