ParameterException
extends WC_Data_Exception
in package
API\Reports\ParameterException class.
Table of Contents
- $error_code : string
- Sanitized error code.
- $error_data : array<string|int, mixed>
- Error extra data.
- __construct() : mixed
- Setup exception.
- getErrorCode() : string
- Returns the error code.
- getErrorData() : array<string|int, mixed>
- Returns error data.
Properties
$error_code
Sanitized error code.
protected
string
$error_code
$error_data
Error extra data.
protected
array<string|int, mixed>
$error_data
Methods
__construct()
Setup exception.
public
__construct(string $code, string $message[, int $http_status_code = 400 ][, array<string|int, mixed> $data = array() ]) : mixed
Parameters
- $code : string
-
Machine-readable error code, e.g
woocommerce_invalid_product_id
. - $message : string
-
User-friendly translated error message, e.g. 'Product ID is invalid'.
- $http_status_code : int = 400
-
Proper HTTP status code to respond with, e.g. 400.
- $data : array<string|int, mixed> = array()
-
Extra error data.
Return values
mixed —getErrorCode()
Returns the error code.
public
getErrorCode() : string
Return values
string —getErrorData()
Returns error data.
public
getErrorData() : array<string|int, mixed>