[wp-trac] [WordPress Trac] #47169: Use a non-zero exit code when requirements are not met

WordPress Trac noreply at wordpress.org
Wed May 8 13:11:07 UTC 2019


#47169: Use a non-zero exit code when requirements are not met
-----------------------------------+---------------------
 Reporter:  jrf                    |       Owner:  (none)
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  5.2.1
Component:  Build/Test Tools       |     Version:  3.0
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+---------------------

Comment (by spacedmonkey):

 @jrf Called `exit` = `false` means `die` isn't called see
 [https://github.com/WordPress/WordPress/blob/6fe64752be3260f2a47f38e68c2cb77400e5a0c9
 /wp-includes/functions.php#L3240-L3242 this]. This means, that `exit( 1 )`
 is called instead of `die` which is the point here. Error code 500 doesn't
 need to be passed here, as wp_die defaults to it.

 The `wp_die` function is function for different outputs and use cases,
 such as xml, json, jsonp, ajax and a nice formatted html page. It is also
 filterable and is usable by WP CLI as well, so that errors are displayed
 there too.

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


More information about the wp-trac mailing list