From e632432886c319bf1996d73507dace46d02c0fbc Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Fri, 15 Jun 2018 00:04:52 +0200 Subject: [PATCH] Fix in error_reporting --- paramecio/citoplasma/error_reporting.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/paramecio/citoplasma/error_reporting.py b/paramecio/citoplasma/error_reporting.py index cd0dfae..41dca47 100644 --- a/paramecio/citoplasma/error_reporting.py +++ b/paramecio/citoplasma/error_reporting.py @@ -4,6 +4,12 @@ from settings import config from paramecio.citoplasma.sendmail import SendMail +import sys, traceback + +email_failed='' + +if hasattr(config, 'email_failed'): + email_failed=config.email_failed class ErrorReportingPlugin(object): @@ -25,14 +31,15 @@ class ErrorReportingPlugin(object): #print('detected error') # Send mail with error. - """ - sendmail=SendMail() + + if email_failed!='': - sendmail.send(email_failed, [email_failed], 'Hubo un error al aƱadir el mail a mailchimp', r.text, content_type='plain', attachments=[]) - print(post.post['email']+'error in mailchimp: '+r.text) + sendmail=SendMail() + + text=traceback.format_exc() + + sendmail.send(email_failed, [email_failed], 'Error reporting from site', text, content_type='plain', attachments=[]) - rv = callback(*args, **kwargs) - """ raise #return rv