Automattic\WooCommerce\Checkout\Helpers

ReserveStockException::__construct()publicWC 1.0

Setup exception.

Method of the class: ReserveStockException{}

No Hooks.

Return

null. Nothing (null).

Usage

$ReserveStockException = new ReserveStockException();
$ReserveStockException->__construct( $code, $message, $http_status_code, $data );
$code(string) (required)
Machine-readable error code, e.g woocommerce_invalid_product_id.
$message(string) (required)
User-friendly translated error message, e.g. 'Product ID is invalid'.
$http_status_code(int)
Proper HTTP status code to respond with, e.g. 400.
Default: 400
$data(array)
Extra error data.
Default: array()

ReserveStockException::__construct() code WC 9.4.2

public function __construct( $code, $message, $http_status_code = 400, $data = array() ) {
	$this->error_code = $code;
	$this->error_data = $data;

	parent::__construct( $message, $http_status_code );
}