raising KeyError when Callsign not found and the session key has just expired

This commit is contained in:
dh1tw 2015-04-14 02:11:25 +02:00
parent 88a80525ad
commit 29a06dda7e

View file

@ -801,7 +801,11 @@ class LookupLib(object):
#if this fails again, raise error
if root.error:
raise AttributeError(root.error.text) #most likely session key invalid
if re.search('Not found', root.error.text, re.I): #No data available for callsign
raise KeyError(root.error.text)
else:
raise AttributeError(root.error.text) #most likely session key invalid
else:
raise AttributeError(root.error.text) #most likely session key missing