WC_REST_WCCOM_Site_Installer_Error::__construct()publicWC 1.0

Constructor for the Installer Error class.

Method of the class: WC_REST_WCCOM_Site_Installer_Error{}

No Hooks.

Return

null. Nothing (null).

Usage

$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(string) (required)
Error code.
$error_message(string)
Error message.
Default: null
$http_code(int)
HTTP status code.
Default: null

WC_REST_WCCOM_Site_Installer_Error::__construct() code WC 8.7.0

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 );
}