Returns the first error as string

@return string
966178
public function getFirstError(): string
    {
        $result = '';
        $errors = $this->getErrors();
        $firstField = reset($errors);

        if ($firstField && isset($firstField[0])) {
            $result = $firstField[0];
        }

        return $result;
    }
1231761
public function getFirstError()
	{
		if( !$this->errors )
			return "";
		$error	= array_pop( array_slice( $this->errors, 0, 1 ) );
		return $this->rules[$error];
	}
649651
public function error()
	{
		// We need this because the error info is discarded by the
		// server the first time you request it, and query() already
		// calls error() once for logging purposes when a query fails.
		static $error = array('code' => 0, 'message' => NULL);

		$message = mssql_get_last_message();
		if ( ! empty($message))
		{
			$error['code']    = $this->query('SELECT @@ERROR AS code')->row()->code;
			$error['message'] = $message;
		}

		return $error;
	}
485061
public function getErrorMessage()
     {
         $messages = $this->getMessage();
         $critical = $this->getCritical();
         $msgError = "";
         $i = 0;
         foreach ($messages as $message ) {

             if ($critical[$i++]) {
                 $msgError .= "{$message}\n";
             }
         }

         return $msgError;
     }
1003804
protected function getError() {
		if ($this->_error === false) {
			if (is_resource($this->stmt)) {
				$this->_error = @oci_error($this->stmt);
			}
			else {
				$this->_error = @oci_error();
			}
		}

		return $this->_error;
	}
1127684
final public function getErrorString()
    {

        $errors = self::getErrors();
        $string = '<ul>';
        foreach ($errors as $error) {
            $string .= '<li>' . $error . '</li>';
        }

        //An ordered lists of all errors;
        return $string . '</ul>';
    }
376485
public function getErrorMessage() {
        if($this->errorMessage) {
            return $this->errorMessage;
        }

        return sprintf(self::$defaultErrorMessagePattern, $this->getName());
    }
1109507
public function getError()
    {
        $error = new Error($this->getMessage());
        $error->setValue($this->value);
        if ($this->field !== null) {
            $error->setName($this->field->getName());
        }
        if ($this->valueIndex !== null) {
            $error->setIndex($this->valueIndex);
        }
        return $error;
    }
504570
public function getErrorRegion()
    {
        $region = '';
        $extra = $this->getExtra();

        if (isset($extra['file']) && file_exists($extra['file'])) {
            $lines = file($extra['file']);

            if (isset($lines[$extra['line'] - 1])) {
                $line = $lines[$extra['line'] - 1];
                $region .= sprintf("\t%s", str_replace("\t", ' ', $line));

                if (($extra['char'] - 1) > 0) {
                    $region .= sprintf("\t%s^\n", str_repeat('-', $extra['char'] - 1));
                }
            }
        }

        return $region;
    }
320107
public function getFirstError($name = null)
    {
        if (!$name) {
            $name = key($this->errors);
        }

        if (!isset($this->errors[$name])) {
            return;
        }

        return current($this->errors[$name]);
    }
886309
public function getErrorsAsText(): string
    {
        $result = '';
        $fieldCounter = 0;
        $fields = $this->getErrors();

        foreach ($fields as $fieldName => $fieldErrors) {
            $fieldCounter++;
            $result .= "$fieldCounter) $fieldName\n";

            foreach ($fieldErrors as $error) {
                $result .= "   - $error\n";
            }
        }

        return $result;
    }
321314
public function getLastError(): string
    {
        if ($this->isConnected() && $this->socket) {
            $err = @socket_last_error($this->socket);
            if ($err) {
                $err = socket_strerror($err);
            }
            if (!$err) {
                $err = 'Unknown error';
            }
            return $err;
        } else {
            return 'Not connected';
        }
    }
1059009
public function errorInfo(): string
    {
        $errorInfo = $this->statement->errorInfo();
        return !isset($errorInfo[0]) || 0 == $errorInfo[0] ? '' : implode(' ', $errorInfo);
    }
183595
public function getErrorsAsString(): string
    {
        $errors = $this->getErrors();
        if (0 === $errors->count()) {
            return '';
        }
        $message = 'found ' . $errors->count() . ' errors validating '
                   . \get_class($this->dataObject);
        foreach ($errors as $error) {
            $message .= "\n\n" . $error->getPropertyPath() . ': ' . $error->getMessage();
        }

        return $message;
    }
596184
public function getErrorText()
    {
        $message = '';
        if ($this->isError()) {
            $message = $this->messages->message[0]->text;
            if (@$this->transactionResponse->errors[0]->errorText) {
                $message = $this->transactionResponse->errors[0]->errorText;
            }
        }
        return $message;
    }
342714
private function getErrorMessage()
    {
        $directivesMessage = '';
        $domainsMessage = '';

        if (!empty($this->invalidValues['directives'])) {
            $directivesMessage = "The following directives are invalid:\n- ";
            $directivesMessage .= implode("\n- ", $this->invalidValues['directives']);
        }

        if (!empty($this->invalidValues['domain'])) {
            $domainsMessage = "The following domains are invalid:\n- ";
            $domainsMessage .= implode("\n- ", $this->invalidValues['domain']);
        }

        return $domainsMessage . "\n" . $directivesMessage;
    }
1281223
public function getErrorMessage()
    {
        $message = $this->getDebugMessage();
        $message .= '<font color="red">ERROR START</font><br>';
        foreach ($this->errorMessage as $items) {
            $message .= "-----------------------------------------------------------------------------------<br>";
            if (is_array($items) || is_object($items)) {
                $message .= "<pre>";
                $message .= $items;
                $message .= "</pre>";
            } elseif (!is_array($items) && !is_object($items)) {
                $message .= $items . '<br/>';
            }
            $message .= "-----------------------------------------------------------------------------------<br>";
        }
        $message .= '<font color="red">ERROR END</font><br>';
        iconv(mb_detect_encoding($message, mb_detect_order(), true), "UTF-8", $message);
        return $message;
    }