Handle decoding error

This commit is contained in:
Phyks 2014-08-18 21:40:38 +02:00
parent 338672624d
commit 25b8db512f
1 changed files with 4 additions and 1 deletions

View File

@ -17,7 +17,10 @@ def get_subject(subject_header):
if tmp[1] is None: if tmp[1] is None:
return str(tmp[0]) return str(tmp[0])
else: else:
return tmp[0].decode(tmp[1]) try:
return tmp[0].decode(tmp[1])
except LookupError:
return "--Unable to fetch subject--"
def send(url, user, password, msg, i=0): def send(url, user, password, msg, i=0):