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

WordPress Trac noreply at wordpress.org
Mon Jun 13 09:52:07 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 davidmosterd):

 @Kau-Boy Your remark on changing the {{{empty}}} check in {{{WP_Error}}}
 bringing up a lot of potential bad effects might be very true. I think
 however it would be very useful to be able to map any type of exception
 from any PHP library to a {{{WP_Error}}} without prefixing it with say
 'context_' or something.

 Maybe a filter before the {{{empty}}} check would work to catch the 0,1
 and 2 cases. Or check more actively on a integer or a string and if that
 fails assume empty. That way the {{{WP_Error}}} code can work without a
 context. This would allow you to use {{{WP_Error}}} more easily as the
 primary interface to errors instead of {{{Exception}}} classes.

 I understand that saying the code has to be something semantic is a design
 choice of {{{WP_Error}}}, which makes sense too.

 If this is something we could consider for WordPress, we could make this
 into it's own ticket. But the comment made sense to  be posted here to me.

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


More information about the wp-trac mailing list