MailPoet\EmailEditor\Validator

Validation_Exception::create_from_wp_error()public staticWC 1.0

Creates a new instance of the exception.

Method of the class: Validation_Exception{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = Validation_Exception::create_from_wp_error( $wp_error ): self;
$wp_error(WP_Error) (required)
WP_Error instance.

Validation_Exception::create_from_wp_error() code WC 9.8.1

public static function create_from_wp_error( WP_Error $wp_error ): self {
	$exception           = self::create()
	->withMessage( $wp_error->get_error_message() );
	$exception->wp_error = $wp_error;
	return $exception;
}