Automattic\WooCommerce\Internal\Admin\Settings\Exceptions
ApiException::__construct
Setup exception.
Метод класса: ApiException{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ApiException = new ApiException(); $ApiException->__construct( $error_code, $message, $http_status_code, $additional_data );
- $error_code(строка) (обязательный)
- Machine-readable error code, e.g
woocommerce_invalid_step_id. - $message(строка) (обязательный)
- User-friendly translated error message, e.g.
'Step ID is invalid'. - $http_status_code(int)
- Proper HTTP status code to respond with.
По умолчанию:400 (Bad request) - $additional_data(массив)
- Extra data (key value pairs) to expose in the error response.
По умолчанию:empty array
Код ApiException::__construct() ApiException:: construct WC 11.0.1
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 );
}