Add error handling for test e-mail.

Review Request #8924 — Created May 7, 2017 and submitted

Information

Review Board
release-2.5.x
20e7b81...

Reviewers

When updating e-mail server settings having "Send a test e-mail after
saving" selected it is helpful to get some feedback when the e-mail
could not be sent. With this change an error message is displayed and
the exception logged.

Configured e-mail server (smtp.gmail.com) with wrong username, wrong
password, no TLS, misspelled server and observed error message and
exception in log for every case. Using an invalid port resulted in a
timeout.

Description From Last Updated

Can you move this over to the release-2.5.x branch and verify it works there? This would be great to have …

brenniebrennie

Can you add some information to the testing done?

brenniebrennie

Instead of using logging.error(msg, exc_info=True), you can just do logging.exception(msg).

brenniebrennie
easyb
brennie
  1. Thanks for the contribution! I have a few minor quibbles:

  2. Show all issues

    Can you move this over to the release-2.5.x branch and verify it works there? This would be great to have on all supported releases!

  3. Show all issues

    Can you add some information to the testing done?

  4. reviewboard/admin/forms.py (Diff revision 1)
     
     
    Show all issues

    Instead of using logging.error(msg, exc_info=True), you can just do logging.exception(msg).

  5. 
      
easyb
brennie
  1. Ship It!
  2. 
      
david
  1. Ship It!
  2. 
      
easyb
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.5.x (0d8c495)