Pop\Db\Adapter\Pdo::showError PHP Метод

showError() публичный Метод

Throw an exception upon a database error.
public showError ( string $code = null, array $info = null ) : void
$code string
$info array
Результат void
    public function showError($code = null, $info = null)
    {
        $errorMessage = null;
        if (null === $code && null === $info) {
            $errorCode = $this->connection->errorCode();
            $errorInfo = $this->connection->errorInfo();
        } else {
            $errorCode = $code;
            $errorInfo = $info;
        }
        if (is_array($errorInfo)) {
            $errorMessage = null;
            if (isset($errorInfo[1])) {
                $errorMessage .= $errorInfo[1];
            }
            if (isset($errorInfo[2])) {
                $errorMessage .= ' : ' . $errorInfo[2];
            }
        } else {
            $errorMessage = $errorInfo;
        }
        throw new Exception('Error: ' . $errorCode . ' => ' . $errorMessage . '.');
    }