action_scheduler_failed_execution action-hookWC 1.0

Runs when action execution fails.

Usage

add_action( 'action_scheduler_failed_execution', 'wp_kama_action_scheduler_failed_execution_action', 10, 3 );

/**
 * Function for `action_scheduler_failed_execution` action-hook.
 * 
 * @param int       $action_id Action ID.
 * @param Exception $e         Exception instance.
 * @param string    $context   Execution context.
 *
 * @return void
 */
function wp_kama_action_scheduler_failed_execution_action( $action_id, $e, $context ){

	// action...
}
$action_id(int)
Action ID.
$e(Exception)
Exception instance.
$context(string)
Execution context.

Where the hook is called

ActionScheduler_Abstract_QueueRunner::handle_action_error()
action_scheduler_failed_execution
woocommerce/packages/action-scheduler/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php 128
do_action( 'action_scheduler_failed_execution', $action_id, $e, $context );

Where the hook is used in WooCommerce

woocommerce/packages/action-scheduler/classes/ActionScheduler_FatalErrorMonitor.php 23
add_action( 'action_scheduler_failed_execution', array( $this, 'untrack_action' ), 0, 0 );
woocommerce/packages/action-scheduler/classes/ActionScheduler_FatalErrorMonitor.php 33
remove_action( 'action_scheduler_failed_execution', array( $this, 'untrack_action' ), 0 );
woocommerce/packages/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_QueueRunner.php 81
add_action( 'action_scheduler_failed_execution', array( $this, 'action_failed' ), 10, 2 );
woocommerce/packages/action-scheduler/classes/abstracts/ActionScheduler_Logger.php 53
add_action( 'action_scheduler_failed_execution', array( $this, 'log_failed_action' ), 10, 3 );