Action_Scheduler\WP_CLI\Action
Run_Command::on_action_failed
Action: action_scheduler_failed_execution
Method of the class: Run_Command{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Run_Command = new Run_Command(); $Run_Command->on_action_failed( $action_id, $e );
- $action_id(int) (required)
- Action ID.
- $e(Exception) (required)
- Exception.
Run_Command::on_action_failed() Run Command::on action failed code WC 10.5.0
public function on_action_failed( $action_id, \Exception $e ) {
if ( 'action_scheduler_failed_execution' !== current_action() ) {
return;
}
$action_id = absint( $action_id );
if ( ! in_array( $action_id, $this->action_ids, true ) ) {
return;
}
$this->action_counts['failed']++;
\WP_CLI::debug( sprintf( 'Action %d failed execution: %s', $action_id, $e->getMessage() ) );
}