From d19d31871f10f9b768e7f161f0fd7eb623085199 Mon Sep 17 00:00:00 2001 From: scribu Date: Mon, 11 Mar 2013 18:32:38 +0200 Subject: [PATCH] handle wpdb error ourselves, instead of waiting for dead_db() --- php/wp-settings-cli.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/php/wp-settings-cli.php b/php/wp-settings-cli.php index dd64be7d..12321c11 100644 --- a/php/wp-settings-cli.php +++ b/php/wp-settings-cli.php @@ -61,6 +61,10 @@ Utils\replace_wp_die_handler(); // Include the wpdb class and, if present, a db.php database drop-in. require_wp_db(); +// WP-CLI: Handle db error ourselves, instead of waiting for dead_db() +if ( !empty( $wpdb->error ) ) + wp_die( $wpdb->error ); + // Set the database table prefix and the format specifiers for database table columns. $GLOBALS['table_prefix'] = $table_prefix; wp_set_wpdb_vars(); -- 2.11.0