[Asterisk-code-review] Adds option to send crash reports via email (testsuite[master])

Matt Jordan asteriskteam at digium.com
Wed Oct 28 13:11:34 CDT 2015


Matt Jordan has posted comments on this change.

Change subject: Adds option to send crash reports via email
......................................................................


Patch Set 5:

(1 comment)

https://gerrit.asterisk.org/#/c/1539/5/lib/python/mailer.py
File lib/python/mailer.py:

Line 43:         smtp_obj = smtplib.SMTP(server)
       :         smtp_obj.set_debuglevel(debug)
       :         smtp_obj.sendmail(sender, recipients, email_text)
       :     except smtplib.SMTPServerDisconnected:
       :         print "Failed to connect to SMTP Server"
       :         return -1
       :     except smtplib.SMTPException as smtp_exception:
       :         print "SMTP Error: {0}".format(smtp_exception)
       :         return -1
       :     except Exception as exception:
       :         msg = "{0}\nError: {1}".format("Exception occurred while trying to "
       :                                        "send email.", exception)
       :         print msg
       :         return -1
       : 
       :     return 0
Again: is there a reason why you are returning a return code in a language that uses exceptions for error notification/handling?

Why are you not just letting exceptions propagate up to the caller of the function, and handling it there?


-- 
To view, visit https://gerrit.asterisk.org/1539
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I17def41f15294a48754269d9c42aa649389840ad
Gerrit-PatchSet: 5
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Jonathan Rose <jrose at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jonathan Rose <jrose at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list