WatchWebsite module: catch Atom parse error
This commit is contained in:
parent
b2662139f5
commit
a975421e02
1 changed files with 6 additions and 1 deletions
|
@ -115,7 +115,12 @@ def alert_change(content, site):
|
||||||
site["_lastpage"] = Atom(content)
|
site["_lastpage"] = Atom(content)
|
||||||
else:
|
else:
|
||||||
site["_lastpage"] = Atom(site["lastcontent"])
|
site["_lastpage"] = Atom(site["lastcontent"])
|
||||||
|
try:
|
||||||
page = Atom(content)
|
page = Atom(content)
|
||||||
|
except:
|
||||||
|
print ("An error occurs during Atom parsing. Restart event...")
|
||||||
|
start_watching(site)
|
||||||
|
return
|
||||||
diff = site["_lastpage"].diff(page)
|
diff = site["_lastpage"].diff(page)
|
||||||
if len(diff) > 0:
|
if len(diff) > 0:
|
||||||
site["_lastpage"] = page
|
site["_lastpage"] = page
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue