WC_Data::error()protectedWC 3.0.0

When invalid data is found, throw an exception unless reading from the DB.

Метод класса: WC_Data{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->error( $code, $message, $http_status_code, $data );
$code(строка) (обязательный)
Error code.
$message(строка) (обязательный)
Error message.
$http_status_code(int)
HTTP status code.
По умолчанию: 400
$data(массив)
Extra error data.
По умолчанию: array()

Список изменений

С версии 3.0.0 Введена.

Код WC_Data::error() WC 8.7.0

protected function error( $code, $message, $http_status_code = 400, $data = array() ) {
	throw new WC_Data_Exception( $code, $message, $http_status_code, $data );
}