Automattic\WooCommerce\Internal\StockNotifications\Frontend

SignupService::get_error_messagepublicWC 1.0

Get the error message for the error code.

Method of the class: SignupService{}

No Hooks.

Returns

String. The error message.

Usage

$SignupService = new SignupService();
$SignupService->get_error_message( $error_code ): string;
$error_code(string) (required)
The error code.

SignupService::get_error_message() code WC 10.3.6

public function get_error_message( string $error_code ): string {
	switch ( $error_code ) {
		case self::ERROR_INVALID_PRODUCT:
			return wp_kses_post( __( 'Invalid product.', 'woocommerce' ) );
		case self::ERROR_INVALID_USER:
			return wp_kses_post( __( 'Invalid user.', 'woocommerce' ) );
		case self::ERROR_INVALID_EMAIL:
			return wp_kses_post( __( 'Invalid email address.', 'woocommerce' ) );
		case self::ERROR_INVALID_OPT_IN:
			return wp_kses_post( __( 'To proceed, please consent to the creation of a new account with your e-mail.', 'woocommerce' ) );
		case self::ERROR_RATE_LIMITED:
			return wp_kses_post( __( 'You have already signed up too many times. Please try again later.', 'woocommerce' ) );
		default:
			return wp_kses_post( __( 'Failed to sign up. Please try again.', 'woocommerce' ) );
	}
}