From 073463d54cf43bae30e576ed2de3ce650fa7769f Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 20 Oct 2023 10:17:26 +0200 Subject: [PATCH] Do not use `die()` when there is a db error --- src/Config_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Config_Command.php b/src/Config_Command.php index 4b38bfa4..b9961457 100644 --- a/src/Config_Command.php +++ b/src/Config_Command.php @@ -165,7 +165,7 @@ public function create( $_, $assoc_args ) { try { mysqli_real_connect( $mysql, $assoc_args['dbhost'], $assoc_args['dbuser'], $assoc_args['dbpass'] ); } catch ( mysqli_sql_exception $exception ) { - die( 'Database connection error (' . $exception->getCode() . ') ' . $exception->getMessage() ); + WP_CLI::error( 'Database connection error (' . $exception->getCode() . ') ' . $exception->getMessage() ); } // phpcs:enable WordPress.DB.RestrictedFunctions }