[wp-meta] [Making WordPress.org] #111: Improve error when running plugins_api() with invalid slug

Making WordPress.org noreply at wordpress.org
Thu Aug 22 18:26:30 UTC 2013


#111: Improve error when running plugins_api() with invalid slug
-------------------+-------------------------------
Reporter:  scribu  |      Owner:
    Type:  defect  |     Status:  new
Priority:  normal  |  Component:  api.wordpress.org
Keywords:          |
-------------------+-------------------------------
 Migrating from #wp20615:
 > 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.


 As nacin says, N; is a serialized null. But we could improve the error
 message.

--
Ticket URL: <http://meta.trac.wordpress.org/ticket/111>
Making WordPress.org <http://meta.trac.wordpress.org/>
WordPress blogging software


More information about the wp-meta mailing list