Gets the error of last operation.

@return null|string The error of last operation, if any
183199
public function getOperationError()
    {
        if (empty($this->sortedQueue)) {
            return;
        }
        $current = current($this->sortedQueue)
                 ? current($this->sortedQueue)
                 : end($this->sortedQueue);

        return $current->getOperationError();
    }
526991
public static function lastErrorMsg()
    {
        if (is_string(self::$error)) {
            return self::$error;
        }

        switch (self::$error) {
            case 0:
                $msg = 'No Error';
                break;

            case self::EXISTS:
                $msg = 'The target path "' . self::$target . '" already exists';
                break;

            case self::IS_LINK:
                $msg = 'The target path "' . self::$target . '" is a symbolic link';
                break;

            case self::NOT_FOUND:
                $msg = 'The target path "' . self::$target . '" does not appear to exist';
                break;

            case self::NOT_DIRECTORY:
                $msg = 'The target path "' . self::$target . '" does not appear to be a folder';
                break;

            case self::NOT_GRAV_ROOT:
                $msg = 'The target path "' . self::$target . '" does not appear to be a Grav instance';
                break;

            case self::ZIP_OPEN_ERROR:
                $msg = 'Unable to open the package file';
                break;

            case self::ZIP_EXTRACT_ERROR:
                $msg = 'Unable to extract the package. ';
                if (self::$error_zip) {
                    switch(self::$error_zip) {
                        case \ZipArchive::ER_EXISTS:
                            $msg .= 'File already exists.';
                            break;

                        case \ZipArchive::ER_INCONS:
                            $msg .= 'Zip archive inconsistent.';
                            break;

                        case \ZipArchive::ER_MEMORY:
                            $msg .= 'Memory allocation failure.';
                            break;

                        case \ZipArchive::ER_NOENT:
                            $msg .= 'No such file.';
                            break;

                        case \ZipArchive::ER_NOZIP:
                            $msg .= 'Not a zip archive.';
                            break;

                        case \ZipArchive::ER_OPEN:
                            $msg .= "Can't open file.";
                            break;

                        case \ZipArchive::ER_READ:
                            $msg .= 'Read error.';
                            break;

                        case \ZipArchive::ER_SEEK:
                            $msg .= 'Seek error.';
                            break;
                    }
                }
                break;

            case self::INVALID_SOURCE:
                $msg = 'Invalid source file';
                break;

            default:
                $msg = 'Unknown Error';
                break;
        }

        return $msg;
    }
807319
public function getError() : ?int 
    {
        if ( ! $this->hasError()) {
            $this->setError($this->getDefaultError());
        }
        return $this->error;
    }
600568
protected function lastErrorWasFatal()
    {
        if ($this->lastException) {
            return true;
        }
        $error = error_get_last();
        return $error && ($error['type'] & self::$fatal_errors) != 0;
    }
883309
final public static function fromLastError()
    {
        $error = error_get_last();
        if ($error !== null) {
            return new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']);
        }
    }
1084661
public function hasError()
	{
		if( isset( $this->info['error'] ) )
			return ( empty( $this->info['error'] ) ? NULL : $this->info['error'] );
		else
			return NULL;
	}
1336959
private function errorCode()
    {
        if ($this->preparedExec == false){
    		$returnValue = $this->dbConnector->errorCode();
    	}
    	else{
    		$returnValue = $this->lastPreparedExecStatement->errorCode();
    	}
        return (string) $returnValue;
    }
36491
public function getLast()
    {
        if (0 === $this->count()) {
            return null;
        }

        end($this->data);

        return current($this->data);
    }
870662
public function getError() {
		switch ($this->error_code) {
			case UPLOAD_ERR_OK:
				return false;
			case UPLOAD_ERR_NO_FILE:
				$error = 'upload:error:no_file';
			case UPLOAD_ERR_INI_SIZE:
			case UPLOAD_ERR_FORM_SIZE:
				$error = 'upload:error:file_size';
			default:
				$error = 'upload:error:unknown';
		}
		return elgg_echo($error);
	}
340959
function ErrorMsg()
	{
		if ($this->_logsql) return $this->_errorMsg;
		if (function_exists('sybase_get_last_message'))
			$this->_errorMsg = sybase_get_last_message();
		else
			$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : 'SYBASE error messages not supported on this platform';
		return $this->_errorMsg;
	}
702370
public function getErrorMessage()
    {
        if (array_key_exists('error', $this->responseData?: [])) {
            if (is_string($this->responseData['error'])) {
                return json_encode($this->responseData['error']);
            } elseif(array_key_exists('error', $this->responseData['error'])) {
                return json_encode($this->responseData['error']['error']);
            } else {
                return json_encode($this->responseData['error']);
            }
        } else {
            return null;
        }
    }
367033
public function last()
    {
        $last = null;
        foreach ($this->each() as $v) {
            $last = $v;
        }
        return $last;
    }
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;
	}
1111923
public function last()
    {
        foreach ($this->dataQuery->lastRow()->execute() as $row) {
            return $this->createDataObject($row);
        }
        return null;
    }
201855
function captureLastError()
    {
        if (null === $error = error_get_last()) {
            return;
        }

        $e = new \ErrorException(
            @$error['message'], 0, @$error['type'],
            @$error['file'], @$error['line']
        );

        return $this->captureException($e);
    }
245953
public function getOperationErrorDescription()
    {
        if (empty($this->sortedQueue)) {
            return;
        }
        $current = current($this->sortedQueue)
                 ? current($this->sortedQueue)
                 : end($this->sortedQueue);

        return $current->getOperationErrorDescription();
    }
538460
public function lastError()
	{

		//put this in try...catch block for better error handling
		try{

			//check if there is a valid service instance
			if ( ! $this->validService() ) 
			{
				//throw error
				throw new MySQLException("Not connected to a valid database service");

			}

			//get the error message and return
			return $this->service->error;

		}

		//diplay error message
		catch(MySQLException $MySQLExceptionObject){

			//display error message
			$MySQLExceptionObject->errorShow();

		}

	}