print errors when no message can be found
This commit is contained in:
parent
f5cf4795eb
commit
e842015892
1 changed files with 9 additions and 1 deletions
|
|
@ -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]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue