print errors when no message can be found

This commit is contained in:
Romain Bignon 2010-11-10 13:25:00 +01:00
commit e842015892

View file

@ -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]