ActionScheduler_Abstract_QueueRunner::handle_action_error()privateWC 1.0

Marks actions as either having failed execution or failed validation, as appropriate.

Method of the class: ActionScheduler_Abstract_QueueRunner{}

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->handle_action_error( $action_id, $e, $context, $valid_action );
$action_id(int) (required)
Action ID.
$e(Exception) (required)
Exception instance.
$context(string) (required)
Execution context.
$valid_action(true|false) (required)
If the action is valid.

ActionScheduler_Abstract_QueueRunner::handle_action_error() code WC 9.3.3

private function handle_action_error( $action_id, $e, $context, $valid_action ) {
	if ( $valid_action ) {
		$this->store->mark_failure( $action_id );
		/**
		 * Runs when action execution fails.
		 *
		 * @param int       $action_id Action ID.
		 * @param Exception $e         Exception instance.
		 * @param string    $context   Execution context.
		 */
		do_action( 'action_scheduler_failed_execution', $action_id, $e, $context );
	} else {
		/**
		 * Runs when action validation fails.
		 *
		 * @param int       $action_id Action ID.
		 * @param Exception $e         Exception instance.
		 * @param string    $context   Execution context.
		 */
		do_action( 'action_scheduler_failed_validation', $action_id, $e, $context );
	}
}