Error

Returns an array containing code and message of the last
database error that has occured.

@return	array
162910
public function error()
	{
		$error = array('code' => '00000', 'message' => '');
		$pdo_error = $this->conn_id->errorInfo();

		if (empty($pdo_error[0]))
		{
			return $error;
		}

		$error['code'] = isset($pdo_error[1]) ? $pdo_error[0].'/'.$pdo_error[1] : $pdo_error[0];
		if (isset($pdo_error[2]))
		{
			 $error['message'] = $pdo_error[2];
		}

		return $error;
	}
586750
public function get_error(){
    if ( $this->error ){
      return [
        'code' => $this->error,
        'text' => $this->class_cfg['errors'][$this->error]
      ];
    }
    return false;
  }
38654
public function getErrorCodes()
    {
        $errors = array();

        if (count($this->errorCodes) > 0)
        {
            foreach ($this->errorCodes as $error)
            {
                switch ($error)
                {
                    case 'timeout-or-duplicate':
                        $errors[] = array(
                            'code' => $error,
                            'name' => 'Timeout or duplicate.',
                        );
                    break;

                    case 'missing-input-secret':
                        $errors[] = array(
                            'code' => $error,
                            'name' => 'The secret parameter is missing.',
                        );
                    break;

                    case 'invalid-input-secret':
                        $errors[] = array(
                            'code' => $error,
                            'name' => 'The secret parameter is invalid or malformed.',
                        );
                    break;

                    case 'missing-input-response':
                        $errors[] = array(
                            'code' => $error,
                            'name' => 'The response parameter is missing.',
                        );
                    break;

                    case 'invalid-input-response':
                        $errors[] = array(
                            'code' => $error,
                            'name' => 'The response parameter is invalid or malformed.',
                        );
                    break;

                    case 'bad-request':
                        $errors[] = array(
                            'code' => $error,
                            'name' => 'The request is invalid or malformed.',
                        );
                    break;

                    case 'internal-empty-response':
                        $errors[] = array(
                            'code' => $error,
                            'name' => 'The recaptcha response is required.',
                        );
                    break;

                    default:
                        $errors[] = array(
                            'code' => $error,
                            'name' => $error,
                        );
                }
            }
        }

        return $errors;
    }
1321391
public function getLastErrorMessage()
    {
        $message = null;
        $error = $this->getConnection()->errorInfo();

        if (is_array($error) && isset($error[2])) {
            $message = $error[2];
        }

        return $message;
    }
1307419
public function getErrorCode()
    {
        $code = '';
        if ($this->isError()) {
            $code = $this->messages->message[0]->code;
            if (@$this->transactionResponse->errors[0]->errorCode) {
                $code = $this->transactionResponse->errors[0]->errorCode;
            }
        }
        return $code;
    }
1211656
private function getLastJsonError()
    {
        static $messages = [
            JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
            JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch',
            JSON_ERROR_CTRL_CHAR => 'Unexpected control character found',
            JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON',
            JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded',
        ];
        $jsonLastError = json_last_error();

        return array_key_exists($jsonLastError, $messages) ? $messages[$jsonLastError] : 'Empty response received';
    }
151390
public function any_error_messages() {
        $errors = array();
        foreach ($this->get_all_slots() as $slot) {
            foreach ($this->for_slot($slot)->get_sub_question_ids() as $subqid) {
                if ($this->for_subq($subqid)->differentweights) {
                    $name = $this->for_subq($subqid)->question->name;
                    $errors[] = get_string('erroritemappearsmorethanoncewithdifferentweight', 'question', $name);
                }
            }
        }
        return $errors;
    }
1051531
public function getErrors(): array
    {
        $errors = $this->validate()->getErrors();
        foreach ($errors as &$error) {
            if (is_string($error) && Translator::isMessage($error)) {
                // translate error message
                $error = $this->say($error);
            }

            unset($error);
        }

        return $errors;
    }
798135
public function getErrors()
	{
		if ($msg = $this->options->message) {
			$errors[] = $msg;
		} else {

			$messages = $this->messages();
			foreach ($this->errors as $code) {
				$errors[] = $messages[$code];
			}
		}

		return $errors;
	}
765154
private function getLastXMLErrorMessage()
    {
        $errorMessage = null;
        $error = libxml_get_last_error();

        if ($error !== false) {
            $errorMessage = trim($error->message);
        }

        return $errorMessage;
    }
880419
public function get_last_error() {
        $error = false;
        // First look for any previously saved stmt error
        if (!empty($this->last_stmt_error)) {
            $error = $this->last_stmt_error;
            $this->last_stmt_error = null;
        } else { // Now try connection error
            $e = oci_error($this->oci);
            if ($e !== false) {
                $error = $e['message'];
            }
        }
        return $error;
    }
1304625
public function getLastErrorMessages()
    {
        $message = '';

        if ($this->hasError()) {

            foreach ($this->errors as $exception) {
                $message .= $exception->getMessage() . ',' . PHP_EOL;
            }
        }

        return $message;
    }
889135
protected function sys_get_errors()
    {
        $errors = sqlsrv_errors(SQLSRV_ERR_ERRORS);
        if (empty($errors)) {
            return "";
        }
        
        $message_array = [];
        
        foreach ($errors as $error) {
            $message_array[$error['message']] = $error['message'];
        }
        
        return implode("\n", $message_array);
    }
167516
public function getErrorMessages()
    {
        $errors = [];
        foreach ($this->fields as $field) {
            if ($field instanceof AbstractFormField && !$field->isValid()) {
                $fldErrors = $field->getErrorMessages();
                $errors = array_merge($errors, $fldErrors);
            }
        }

        return $errors;
    }
1121729
public function getErrors()
    {
        $diff = array_diff_key($this->_properties, $this->_errors);

        return $this->_errors + (new Collection($diff))
            ->filter(function ($value) {
                return is_array($value) || $value instanceof EntityInterface;
            })
            ->map(function ($value) {
                return $this->_readError($value);
            })
            ->filter()
            ->toArray();
    }
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;
        }
    }
655474
public function getErrors()
    {
        $aErrors = Array();
        if (empty( $this->_errors )) {
            if (is_array($this->_getField(self::$ERROR))) {
                foreach ($this->_getField(self::$ERROR) as $error) {
                    $errorCode       = isset( $error[self::$ERROR_CODE] ) ? $error[self::$ERROR_CODE] : 0;
                    $message         = isset( $error[self::$ERROR_MESSAGE] ) ? $error[self::$ERROR_MESSAGE] : '';
                    $consumerMessage = isset( $error[self::$ERROR_CONSUMER_MESSAGE] ) ? $error[self::$ERROR_CONSUMER_MESSAGE] : '';
                    $paySysMessage   = isset( $error[self::$ERROR_PAYSYS_MESSAGE] ) ? $error[self::$ERROR_PAYSYS_MESSAGE] : '';

                    $error = new WirecardCEE_QMore_Error($errorCode, $message);
                    $error->setConsumerMessage($consumerMessage);
                    $error->setPaySysMessage($paySysMessage);

                    $aErrors[] = $error;
                }
            }

            $this->_errors = $aErrors;
        }

        return $this->_errors;
    }