wc_migrator_error_occurred
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
wc_migrator_error_occurred
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'], ) );