Gives the last response with an error code.
This may or may not be the same as the last response if multiple requests were made.
@return array associative array of HTTP response or <b>NULL</b> if no error response yet
@see getLastResponse
181075
public function getLastErrorResponse() {
        if (!empty($this->rawResponses)) {
            foreach (array_reverse($this->rawResponses) as $x) {
                if (isset($x['error'])) {
                    return $x;
                }
            }
        }
    }
36491
public function getLast()
    {
        if (0 === $this->count()) {
            return null;
        }

        end($this->data);

        return current($this->data);
    }
379480
private function getStatus()
    {
        if (!($statusArray = preg_grep('/^HTTP\/(1.0|1.1)\s+(\d+)\s+(.+)/', $this->headers))) {
            throw new \RuntimeException('Could not determine HTTP status from API response');
        }

        if (!preg_match('/^HTTP\/(1.0|1.1)\s+(\d+)\s+(.+)/', $statusArray[0], $matchesArray)) {
            throw new \RuntimeException('Could not determine HTTP status from API response');
        }

        return array(
            'code' => $matchesArray[2],
            'message' => $matchesArray[3],
        );
    }
285197
public function LastLink()
    {
        return HTTP::setGetVar(
            $this->getPaginationGetVar(),
            ($this->TotalPages() - 1) * $this->getPageLength(),
            ($this->request instanceof HTTPRequest) ? $this->request->getURL(true) : null
        );
    }
1096753
public function getLastCriterion()
    {
        $count = count($this->map);
        if ($count) {
            $map = array_values($this->map);

            return $map[$count - 1];
        }

        return null;
    }
1374709
public function getLastRequest() {
		$path = $this->tmpDir . DIRECTORY_SEPARATOR . self::LAST_REQUEST_FILE;
		if( file_exists($path) ) {
			$content = file_get_contents($path);
			$data    = @unserialize($content);
			if( $data instanceof RequestInfo ) {
				return $data;
			}
		}

		return null;
	}
903266
protected function GetErrorCodesFromResponse()
    {
        $sReturnMessage = false;
        $oGlobal = TGlobal::instance();
        $this->sRefNo = $oGlobal->GetUserData('refno');
        $sReturnState = $oGlobal->GetUserData('status');
        if ($this->bIsCorrectPaymentType()) {
            $oBasket = TShopBasket::GetInstance();
            if ($this->sRefNo == crc32($oBasket->sBasketIdentifier.'__'.$this->GetRefNoPaymentId().'__'.$this->sRefNoCount)) {
                if ('error' == $sReturnState) {
                    $sResponseHash = $this->GetSecurityHash($this->GetTestLiveModeParameter('sign'), $oGlobal->GetUserData('merchantId'), $oGlobal->GetUserData('amount'), $oGlobal->GetUserData('currency'), $oGlobal->GetUserData('refno'));
                    if ($sResponseHash == $oGlobal->GetUserData('sign')) {
                        $sReturnMessage = $oGlobal->GetUserData('errorDetail');
                        $sReturnMessage = $this->TransformDataTransMessages($oGlobal->GetUserData('errorCode'));
                    } else {
                        $sReturnMessage = 'ERROR_PAYMENT_DATA_TRANS_SECURITY_CHECK_ERROR';
                    }
                } elseif ('cancel' == $sReturnState) {
                    $sResponseHash = $this->GetSecurityHash($this->GetTestLiveModeParameter('sign'), $oGlobal->GetUserData('merchantId'), $oGlobal->GetUserData('amount'), $oGlobal->GetUserData('currency'), $oGlobal->GetUserData('refno'));
                    if ($sResponseHash == $oGlobal->GetUserData('sign')) {
                        $sReturnMessage = 'ERROR_PAYMENT_DATA_TRANS_PAYMENT_CANCEL';
                    } else {
                        $sReturnMessage = 'ERROR_PAYMENT_DATA_TRANS_SECURITY_CHECK_ERROR';
                    }
                } else {
                    $sTransactionId = $oGlobal->GetUserData('uppTransactionId');
                    $sAuthorisedAmount = $oGlobal->GetUserData('amount');
                    $sResponseHash = $this->GetSecurityHash($this->GetTestLiveModeParameter('sign2'), $oGlobal->GetUserData('merchantId'), $oGlobal->GetUserData('amount'), $oGlobal->GetUserData('currency'), $oGlobal->GetUserData('uppTransactionId'));
                    if ($sResponseHash == $oGlobal->GetUserData('sign2')) {
                        if (strlen($sTransactionId) <= 0 || strlen($sAuthorisedAmount) <= 0) {
                            $sReturnMessage = 'ERROR_PAYMENT_DATA_TRANS_MISSING_PARAMETER_IN_RESPONSE';
                            TTools::WriteLogEntrySimple('Payment DataTrans: Beim Autorisierungsresponse wurden benötigte Daten nicht zurückgegeben', 1, __FILE__, __LINE__);
                        } else {
                            $this->sTransactionId = $sTransactionId;
                            $this->sAuthorisedAmount = $sAuthorisedAmount;
                        }
                    } else {
                        $sReturnMessage = 'ERROR_PAYMENT_DATA_TRANS_SECURITY_CHECK_ERROR';
                    }
                }
            } else {
                $sReturnMessage = 'ERROR_PAYMENT_DATA_TRANS_REFERENCE_NUMER_NOT_VALID';
            }
        } else {
            $sReturnMessage = 'ERROR_PAYMENT_DATA_TRANS_PAYMEN_SELECTION_NOT_VALID';
        }

        return $sReturnMessage;
    }
1068698
protected function GetErrorCodesFromResponse()
    {
        $SReturnMessage = false;
        if ($this->bIsCorrectIPaymentType()) {
            $oGlobal = TGlobal::instance();
            $SReturnState = $oGlobal->GetUserData('ret_status');
            if ('ERROR' == $SReturnState) {
                $SReturnMessage = $oGlobal->GetUserData('ret_errormsg');
                $SReturnMessage = utf8_encode($SReturnMessage);
            }
        }

        return $SReturnMessage;
    }
381524
public function getStatus(){

        // set response to json
        $this->setEndpoint('json');

        // get response
        $obj = json_decode( $this->get(), true);

        return array_get($obj, 'status', null);

    }
367033
public function last()
    {
        $last = null;
        foreach ($this->each() as $v) {
            $last = $v;
        }
        return $last;
    }
1344801
public function error()
    {

        $res = $this->response();

        if (!$res) {
            return null;
        }

        if ($this->ok()) {
            return null;
        }

        $message = ($res->getStatusCode() ? $res->getStatusCode() . ' ' : '') .
                   ($res->getReasonPhrase() ? $res->getReasonPhrase() : 'Unknown response reason phrase');

        try {

            $data = $this->json();

            if (!empty($data->message)) {
                $message = $data->message;
            }

            if (!empty($data->error_description)) {
                $message = $data->error_description;
            }

            if (!empty($data->description)) {
                $message = $data->description;
            }

        } catch (Exception $e) {
            // This should never happen
            $message .= ' (and additional error happened during JSON parse: ' . $e->getMessage() . ')';
        }

        return $message;

    }
1000060
public function getLastPageParams()
    {
        $limit = $this->limit <= 0 ? $this->count : $this->limit;
        $last_page = intdiv(intval($this->count), intval($limit));
        $last_url = $this->offset_key
            . ($last_page * $limit)
            . $this->limit_key
            . $limit;

        return $last_url;
    }
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';
        }
    }
665104
public function last()
	{
		$set = array_slice($this->list, -1, 1, true);
		
		return isset($set[0]) ? $set[0] : null;
	}
1226602
private function getLastJsonResponse(): stdClass
    {
        if (null === ($decoded = json_decode($this->restContext->getMink()->getSession()->getDriver()->getContent()))) {
            throw new \RuntimeException('JSON response seems to be invalid');
        }

        return $decoded;
    }
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;
	}
1191409
public function get_last_error() {
        $retErrors = sqlsrv_errors(SQLSRV_ERR_ALL);
        $errorMessage = 'No errors found';

        if ($retErrors != null) {
            $errorMessage = '';

            foreach ($retErrors as $arrError) {
                $errorMessage .= "SQLState: ".$arrError['SQLSTATE']."<br>\n";
                $errorMessage .= "Error Code: ".$arrError['code']."<br>\n";
                $errorMessage .= "Message: ".$arrError['message']."<br>\n";
            }
        }

        return $errorMessage;
    }