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()
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 ); }
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |