From e842015892bfb09eb48d5a945e648b9013eccee6 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Wed, 10 Nov 2010 13:25:00 +0100 Subject: [PATCH] print errors when no message can be found --- weboob/applications/monboob/monboob.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/weboob/applications/monboob/monboob.py b/weboob/applications/monboob/monboob.py index 74ecb271..e1daf20a 100644 --- a/weboob/applications/monboob/monboob.py +++ b/weboob/applications/monboob/monboob.py @@ -151,11 +151,19 @@ class Monboob(ReplApplication): content += unicode(s, charset) else: content += unicode(s) - except: + except UnicodeError, e: + self.logger.warning('Unicode error: %s' % e) + continue + except Exception, e: + self.logger.exception(e) continue else: break + if len(content) == 0: + print >>sys.stderr, 'Unable to send an empty message' + return 1 + # remove signature content = content.split(u'\n-- \n')[0]