Browse Source

Do not raise Exception when image not exists

Just output a warning and go on with further jobs
develop
Jonathan Golder 4 years ago
parent
commit
638d2b6a3d
  1. 10
      euroexange/euroexange.py

10
euroexange/euroexange.py

@ -238,11 +238,13 @@ class EuroExangeBot( pywikibot.bot.BaseBot ):
self.current_job.filepage = pywikibot.page.FilePage(
pywikibot.Site(), job.image)
# Stop if file not jet exists
# Skip if file not yet exists
if not self.current_job.filepage.exists():
jogobot.output( "Work on Job {}".format( self.current_job.image),
"ERROR" )
raise pywikibot.NoPage( self.current_job.filepage )
jogobot.output( "Image {} does not exists on wiki, job skipped!".
format( self.current_job.image), "WARNING" )
return
#~ raise pywikibot.NoPage( self.current_job.filepage )
# Check if update is necessary
if self.image_update_needed():

Loading…
Cancel
Save