[wp-trac] [WordPress Trac] #27419: Widget Customizer: Remove/Replace Widget_Customizer_Exception

WordPress Trac noreply at wordpress.org
Fri Mar 14 21:36:12 UTC 2014


#27419: Widget Customizer: Remove/Replace Widget_Customizer_Exception
-------------------------+--------------------
 Reporter:  ocean90      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  3.9
Component:  Appearance   |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:
-------------------------+--------------------

Comment (by westonruter):

 The majority of situations where `Widget_Customizer_Exception` is used
 it's intended to be used internally, so that the methods can throw this
 exception and handle it appropriately, for example:
 https://github.com/x-team/wordpress-
 develop/blob/b6e2bd9f0e8d49026c0b02f869124a749d68aac1/src/wp-includes
 /class-wp-customize-widgets.php#L1039-L1091

 `WP_Customize_Widgets::parse_widget_setting_id()` throws this exception
 without catching it, so perhaps it can return a `WP_Error`, but we'd need
 to check the return value for `is_wp_error()` whenever it is used.

 `WP_Customize_Widgets::call_widget_update()` throws this exception,
 catches it, and then re-throws it after rolling back the options
 transaction, so in this case a generic `Exception` would do:
 https://github.com/x-team/wordpress-
 develop/blob/b6e2bd9f0e8d49026c0b02f869124a749d68aac1/src/wp-includes
 /class-wp-customize-widgets.php#L1035

 Thoughts?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27419#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list