[wp-trac] [WordPress Trac] #20615: Unknown error when running plugins_api() with invalid slug

WordPress Trac wp-trac at lists.automattic.com
Sat May 5 14:59:08 UTC 2012


#20615: Unknown error when running plugins_api() with invalid slug
--------------------------------+---------------------------
 Reporter:  scribu              |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  WordPress.org
Component:  WordPress.org site  |    Version:
 Severity:  normal              |   Keywords:
--------------------------------+---------------------------
 Input:

 {{{
 $api = plugins_api( 'plugin_information', array( 'slug' => 'doesnt-exist'
 ) );

 var_dump( $api );
 }}}

 Expected result:

 {{{
 WP_Error Object
 (
     [errors] => Array
         (
             [invalid_slug] => Array
                 (
                     [0] => Invalid plugin slug.
                 )

         )

     [error_data] => Array
         (
             [invalid_slug] => 404;
         )
 )
 }}}

 Actual result:

 {{{
 WP_Error Object
 (
     [errors] => Array
         (
             [plugins_api_failed] => Array
                 (
                     [0] => An unknown error occurred during the API
 request.
                 )

         )

     [error_data] => Array
         (
             [plugins_api_failed] => N;
         )
 )
 }}}

 PS: I have no idea what that 'N' is supposed to represent.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20615>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list