WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\Domain\Services

CreateAccount::map_create_account_error() private WC 1.0

Convert an account creation error to an exception.

{} It's a method of the class: CreateAccount{}

No Hooks.

Return

Exception..

Usage

// private - for code of main (parent) class only
$result = $this->map_create_account_error( $error );
$error(WP_Error) (required)
An error object.

Code of CreateAccount::map_create_account_error() WC 5.6.0

private function map_create_account_error( \WP_Error $error ) {
	switch ( $error->get_error_code() ) {
		// WordPress core error codes.
		case 'empty_username':
		case 'invalid_username':
		case 'empty_email':
		case 'invalid_email':
		case 'email_exists':
		case 'registerfail':
			return new \Exception( 'woocommerce_rest_checkout_create_account_failure' );
	}

	return new \Exception( 'woocommerce_rest_checkout_create_account_failure' );
}