Action_Scheduler\WP_CLI\Action

Generate_Command::print_error │ protected │ WC 1.0

Convert an exception into a WP CLI error.

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

Хуков нет.

Возвращает

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

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->print_error( $e );
$e(Exception) (обязательный)
The error object.

Код Generate_Command::print_error() WC 11.2.2

protected function print_error( \Exception $e ) {
	\WP_CLI::error(
		sprintf(
			/* translators: %s refers to the exception error message. */
			__( 'There was an error creating the scheduled action: %s', 'woocommerce' ),
			$e->getMessage()
		)
	);
}