Returns the last error occurred (e.g. when updating/inserting failed)

@return array Hash array with the following fields: type, message
11025
function get_error()
    {
        $err = $this->error;

        // check ldap connection for errors
        if (!$err && $this->ldap->get_error()) {
            $err = array(self::ERROR_SEARCH, $this->ldap->get_error());
        }

        return $err;
    }
312699
public function getError()
    {
        if (!$this->isDone() || is_null($this->lastProtoResponse->getError())) {
            return null;
        }
        return $this->lastProtoResponse->getError();
    }
181075
public function getLastErrorResponse() {
        if (!empty($this->rawResponses)) {
            foreach (array_reverse($this->rawResponses) as $x) {
                if (isset($x['error'])) {
                    return $x;
                }
            }
        }
    }
36385
public function errorInfo()
    {
        if (!$this->_stmt) {
            return false;
        }

        $error = sqlsrv_errors();
        if (!$error) {
            return false;
        }

        return array(
            $error[0]['code'],
            $error[0]['message'],
        );
    }
249174
public function error() {
		$errors = array();

		foreach (func_get_args() as $msg) {
			if (is_array($msg)) {
				$errors = array_merge($errors, $msg);
			} else {
				$errors[] = $msg;
			}
		}
		
		return count($errors) ? $errors : array(self::ERROR_UNKNOWN);
	}
133189
public function lastError(bool $onlyMsg = true)
    {
        if (!$errors = $this->_errors) {
            return $onlyMsg ? '' : [];
        }

        $last = \array_pop($errors);
        return $onlyMsg ? $last['msg'] : $last;
    }
890577
public function errorMessages()
    {
        $msgs = array();
        foreach ($this->errors as $key => $values) {
            foreach ($values as $value) {
                array_push($msgs, "$key $value");
            }
        }
        return $msgs;
    }
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;
        }
    }
418780
public function getErrors(): array
    {
        $error = [];

        foreach ($this->list as $r) {
            $error[$r->getPropertyPath()] = $r->getMessage();
        }

        return $error;
    }
201653
public function getError() {
        return (object) [
            "code"    => $this->getCode(),
            "message" => $this->getMessage(),
            "details" => $this->getDetails(),
            "key"     => $this->getKey()
        ];
    }
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;
    }
774155
public function error() {
        $this->error = $this->_mongo->lastError();
        trace($this->error,'','ERR');
        return $this->error;
    }
1137392
public function errorInfo()
    {
        $e = oci_error($this->sth);

        if (is_array($e)) {
            return [
                'HY000',
                $e['code'],
                $e['message'],
            ];
        }

        return ['00000', null, null];
    }
405426
public function getFormErrors ()
    {
        return array_map(function (FormValidator $formValidator) {
            return $formValidator->getErrorMsg();
        }, array_filter($this->validators, function (FormValidator $validator) {
            return !$validator->isValid();
        }));
    }
885318
public function getLastRuntimeMessage()
    {
        end($this->runtime_messages);
        $value = current($this->runtime_messages);
        reset($this->runtime_messages);

        return $value;
    }
1192400
public function getInvalidErrors()
    {
        return array_combine(
            array_keys($this->invalidAttribs),
            array_map(function ($ref) {
                return $ref['error'];
            }, array_values($this->invalidAttribs))
        );
    }
178191
public function getAllMessages()
    {
        $messages = [];
        foreach (array_keys($this->errors) as $key) {
            $messages = array_merge($messages, $this->getMessages($key));
        }
        return $messages;
    }