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

WordPress Trac noreply at wordpress.org
Sun Jun 26 13:41:40 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:
--------------------------------------+-----------------------------

Comment (by stephenharris):

 Why not include the original exception code in the the  `WP_Error` in the
 data argument? There's no precedent for the error code of a `WP_Error`
 instance to be unique to the underlying cause - though, clearly being able
 to distinguish between them would be desirable.

 Setting a fixed error code would fix the bug, provide consistency and the
 data attribute would provide for a more precise diagnosis.

 Alternatively, I don't see any major disadvantages to prefixing the error
 code by 'phpmailer_'.

 The only minor issue with both of these suggestions is that it changes the
 error code (and someone might be checking for '2' or '3') - but that's
 probably not very likely, and in any case, they should have some generic
 fallback.

 There would be greater risk in changing the behaviour of `WP_Error`.

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


More information about the wp-trac mailing list