[wp-trac] [WordPress Trac] #16769: Make WP_Error extending Exception to make it throw-able

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 29 10:39:02 UTC 2011


#16769: Make WP_Error extending Exception to make it throw-able
-------------------------+-----------------------------
 Reporter:  hakre        |       Owner:
     Type:  enhancement  |      Status:  closed
 Priority:  lowest       |   Milestone:  Future Release
Component:  General      |     Version:  3.1
 Severity:  normal       |  Resolution:  fixed
 Keywords:               |
-------------------------+-----------------------------

Comment (by hakre):

 Replying to [comment:12 scribu]:
 > [..] The only place exceptions would be somewhat useful would be in the
 taxonomy API, but since most of the functions there can also be called
 directly, you would probably end up with more try / catch blocks than
 is_wp_error() checks.

 I do not know that much about the taxnonomy API, but a place where
 returning error values does not work is the instantiation of objects.
 Constructors can never return a WP_Error object nor false on error (as
 long as the class of the object is not WP_Error).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16769#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list