From 2ff418d9822dc564c14a273e2935feff35cb3b10 Mon Sep 17 00:00:00 2001 From: Darshan Sawardekar Date: Wed, 8 May 2024 15:34:38 +0530 Subject: [PATCH] Fixes export log status in case of failure --- includes/classes/CatalogCommand.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/classes/CatalogCommand.php b/includes/classes/CatalogCommand.php index dc65b8e..d07cba9 100644 --- a/includes/classes/CatalogCommand.php +++ b/includes/classes/CatalogCommand.php @@ -252,6 +252,8 @@ public function export( $args = [], $opts = [] ) { if ( is_wp_error( $result ) ) { \WP_CLI::error( $result->get_error_message() ); + } else if ( ! $result['success'] ) { + \WP_CLI::error( $result['message'] ); } else { \WP_CLI::success( $result['message'] ); }