[wp-trac] [WordPress Trac] #19073: wp_die() can be a wrapper for WP_Error objects, but also triggers if no error is present

WordPress Trac wp-trac at lists.automattic.com
Sun Oct 30 12:45:33 UTC 2011


#19073: wp_die() can be a wrapper for WP_Error objects, but also triggers if no
error is present
--------------------------+------------------------------
 Reporter:  F J Kaiser    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.3
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by F J Kaiser):

 Replying to [comment:3 OoroonBai]:
 > Why is it a senseless behavior? You can create errors without a message.

 First, I'd say if you translate errors, you should also translate the
 error titles.

 > If someone translate the above string 'New error' with an empty string,
 than wp_die() would not not stop the script. But wp_die() should always
 stop the script when it is called.

 If you got an incomplete translation and bundle it with your theme, then
 it's your fault as theme developer. You should never bundle unfinished
 parts, else you're before RC, even before beta status with your theme.
 When offering incomplete Errors due to missing translation strings it
 won't be of any help. And of how much help could a blank wp_die page be?
 IMHO: none. Errors are meant to help the developer. So: why display it
 anyway if you can't offer any help?

 Sidenote: You don't have to offer the empty second argument for
 {{{wp_die()}}} and you also don't need to call the error data as 3rd.
 That's the reason why I'm after this: Just drop your error object in and
 you're fine. The rest will be done by wp_die() automatically.

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


More information about the wp-trac mailing list