RouteException::__construct( string $error_code, string $message, int $http_status_code = 400, array $additional_data = array() )

Setup exception.


Description Description


Parameters Parameters

$error_code

(Required) Machine-readable error code, e.g woocommerce_invalid_product_id.

$message

(Required) User-friendly translated error message, e.g. 'Product ID is invalid'.

$http_status_code

(Optional) Proper HTTP status code to respond with, e.g. 400.

Default value: 400

$additional_data

(Optional) Extra data (key value pairs) to expose in the error response.

Default value: array()


Top ↑

Source Source

File: packages/woocommerce-blocks/src/StoreApi/Routes/RouteException.php


			


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.