Unverified Commit 5d76d0c0 authored by Nick Daugherty's avatar Nick Daugherty Committed by GitHub
Browse files

Merge pull request #151 from Automattic/150-no-error-when-event-not-found

Exit without an error status when event is not found
parents 39730aba 381d38da
......@@ -84,7 +84,15 @@ class Orchestrate_Runner extends \WP_CLI_Command {
$run = \Automattic\WP\Cron_Control\run_event( $timestamp, $action, $instance );
if ( is_wp_error( $run ) ) {
$error_data = $run->get_error_data();
if ( isset( $error_data['status'] ) && 404 === $error_data['status'] ) {
\WP_CLI::warning( $run->get_error_message() );
exit;
} else {
\WP_CLI::error( $run->get_error_message() );
}
} elseif ( isset( $run['success'] ) && true === $run['success'] ) {
\WP_CLI::success( $run['message'] );
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment