WC_Data::error( string $code, string $message, int $http_status_code = 400, array $data = array() )

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


Description Description


Parameters Parameters

$code

(Required) Error code.

$message

(Required) Error message.

$http_status_code

(Optional) HTTP status code.

Default value: 400

$data

(Optional) Extra error data.

Default value: array()


Top ↑

Source Source

File: includes/abstracts/abstract-wc-data.php

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

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.