Automattic\WooCommerce\Internal\Admin\Settings\Exceptions

ApiException::__constructpublicWC 1.0

Setup exception.

Method of the class: ApiException{}

No Hooks.

Returns

null. Nothing (null).

Usage

$ApiException = new ApiException();
$ApiException->__construct( $error_code, $message, $http_status_code, $additional_data );
$error_code(string) (required)
Machine-readable error code, e.g woocommerce_invalid_step_id.
$message(string) (required)
User-friendly translated error message, e.g. 'Step ID is invalid'.
$http_status_code(int)
Proper HTTP status code to respond with.
Default: 400 (Bad request)
$additional_data(array)
Extra data (key value pairs) to expose in the error response.
Default: empty array

ApiException::__construct() code WC 10.7.0

public function __construct( string $error_code, string $message, int $http_status_code = 400, array $additional_data = array() ) {
	$this->error_code      = $error_code;
	$this->additional_data = array_filter( (array) $additional_data );
	parent::__construct( $message, $http_status_code );
}