WC_REST_WCCOM_Site_Installer_Error::__construct()publicWC 1.0

Constructor for the Installer Error class.

Метод класса: WC_REST_WCCOM_Site_Installer_Error{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WC_REST_WCCOM_Site_Installer_Error = new WC_REST_WCCOM_Site_Installer_Error();
$WC_REST_WCCOM_Site_Installer_Error->__construct( $error_code, $error_message, $http_code );
$error_code(строка) (обязательный)
Error code.
$error_message(строка)
Error message.
По умолчанию: null
$http_code(int)
HTTP status code.
По умолчанию: null

Код WC_REST_WCCOM_Site_Installer_Error::__construct() WC 9.8.2

public function __construct( $error_code, $error_message = null, $http_code = null ) {
	$this->error_code    = $error_code;
	$this->error_message = $error_message ?? WC_REST_WCCOM_Site_Installer_Error_Codes::ERROR_MESSAGES[ $error_code ] ?? '';
	$this->http_code     = $http_code ?? WC_REST_WCCOM_Site_Installer_Error_Codes::HTTP_CODES[ $error_code ] ?? 400;

	parent::__construct( $error_code );
}