OSDN Git Service

allow WP_CLI::error() to do its thing
authorscribu <mail@scribu.net>
Sun, 28 Jul 2013 16:17:14 +0000 (19:17 +0300)
committerscribu <mail@scribu.net>
Sun, 28 Jul 2013 16:27:23 +0000 (19:27 +0300)
(it prints both the error message and any additional data)

php/commands/plugin.php
php/commands/theme.php

index 630dbee..e95c568 100644 (file)
@@ -156,10 +156,7 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade {
                $api = plugins_api( 'plugin_information', array( 'slug' => $slug ) );
 
                if ( is_wp_error( $api ) ) {
-                       if ( null === maybe_unserialize( $api->get_error_data() ) )
-                               WP_CLI::error( "Can't find the plugin in the WordPress.org repository." );
-                       else
-                               WP_CLI::error( $api );
+                       WP_CLI::error( $api );
                }
 
                if ( isset( $assoc_args['version'] ) ) {
index 843bf8d..8db618b 100644 (file)
@@ -106,10 +106,7 @@ class Theme_Command extends \WP_CLI\CommandWithUpgrade {
                $api = themes_api( 'theme_information', array( 'slug' => $slug ) );
 
                if ( is_wp_error( $api ) ) {
-                       if ( null === maybe_unserialize( $api->get_error_data() ) )
-                               WP_CLI::error( "Can't find the theme in the WordPress.org repository." );
-                       else
-                               WP_CLI::error( $api );
+                       WP_CLI::error( $api );
                }
 
                if ( isset( $assoc_args['version'] ) ) {