wc_migrator_error_occurred action-hookWC 10.3.0

Fires when an error occurs during migration.

Usage

add_action( 'wc_migrator_error_occurred', 'wp_kama_wc_migrator_error_occurred_action', 10, 3 );

/**
 * Function for `wc_migrator_error_occurred` action-hook.
 * 
 * @param string $error_type The type of error (fetch, mapping, import).
 * @param string $message    The error message.
 * @param array  $context    Additional error context.
 *
 * @return void
 */
function wp_kama_wc_migrator_error_occurred_action( $error_type, $message, $context ){

	// action...
}
$error_type(string)
The type of error (fetch, mapping, import).
$message(string)
The error message.
$context(array)
Additional error context.

Changelog

Since 10.3.0 Introduced.

Where the hook is called

ProductsController::execute_migration_loop()
wc_migrator_error_occurred
ProductsController::process_batch()
wc_migrator_error_occurred
woocommerce/src/Internal/CLI/Migrator/Core/ProductsController.php 259-267
do_action(
	'wc_migrator_error_occurred',
	'fetch',
	$e->getMessage(),
	array(
		'batch_args' => $batch_args,
		'platform'   => $this->parsed_args['platform'],
	)
);
woocommerce/src/Internal/CLI/Migrator/Core/ProductsController.php 645-653
do_action(
	'wc_migrator_error_occurred',
	'mapping',
	$e->getMessage(),
	array(
		'product_data' => $product_data,
		'platform'     => $this->parsed_args['platform'],
	)
);

Where the hook is used in WooCommerce

Usage not found.