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

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 7 19:05:33 UTC 2011


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

 * severity:  trivial => normal


Comment:

 Replying to [comment:5 westi]:
 > Switching to an Exception and throwing it changes the whole way in which
 we use WP_Error.

 Well actually prior to PHP 5 exceptions were not available but the
 suggestion given with the patch is not changing much so far, it's just
 extending the current.

 > I'm not convinced we need to do this.
 >
 >  * What is the benefit?

 To have an WP based, throw-able error class. If you don't know what the
 benefit of a concrete exception class is, please let us know.

 >  * How is this backwards compatible with old code?

 I expect it to be 100% compatible. The WP_Error class can be instantiated
 as known and returned from functions. If you see some scenarios where this
 should not be the case, please report them in this ticket.

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


More information about the wp-trac mailing list