[wp-trac] [WordPress Trac] #35598: Use different error code for PHPMailer exceptions in wp_mail_failed

WordPress Trac noreply at wordpress.org
Sun Jun 12 13:44:28 UTC 2016


#35598: Use different error code for PHPMailer exceptions in wp_mail_failed
--------------------------------------+-----------------------------
 Reporter:  Kau-Boy                   |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Future Release
Component:  Mail                      |     Version:  4.4.1
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------
Changes (by swissspidy):

 * keywords:  has-patch needs-unit-tests => has-patch has-unit-tests


Comment:

 Note that with your patch the hook's docblock isn't correct anymore (“A
 WP_Error object with the phpmailerException code, message…”).

 As you pointed out, PHPMailer doesn't always use zeroes for the exception
 code. Therefore developers might expect another error code.

 What about changing the `empty` check in the `WP_Error` constructor
 instead? Or using `WP_Error:add()` to add the error code so it's not lost?

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


More information about the wp-trac mailing list