Skip to content

Commit

Permalink
handle pages that get deleted after the bot starts running
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Fossati committed Jul 19, 2019
1 parent 00ce36e commit 4dd2cb9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion soweego/ingester/wikidata_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import click
import pywikibot
from pywikibot.exceptions import NoPage

from soweego.commons import target_database
from soweego.commons.constants import QID_REGEX
Expand Down Expand Up @@ -552,7 +553,12 @@ def _essential_checks(
while item.isRedirectPage():
item = item.getRedirectTarget()

data = item.get()
try:
data = item.get()
except NoPage:
LOGGER.warning("%s doesn't exist anymore", subject)
return None, None

# No data at all
if not data:
LOGGER.warning('%s has no data at all', subject)
Expand Down

0 comments on commit 4dd2cb9

Please sign in to comment.