WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Routes

RouteException::__construct() public WC 1.0

Setup exception.

{} It's a method of the class: RouteException{}

No Hooks.

Return

null. Nothing.

Usage

$RouteException = new RouteException();
$RouteException->__construct( $error_code, $message, $http_status_code, $additional_data );
$error_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
$additional_data(array)
Extra data (key value pairs) to expose in the error response.
Default: []

Code of RouteException::__construct() WC 5.8.0

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