From 638d2b6a3d951a913c95cc18d449b940e7d6bcd6 Mon Sep 17 00:00:00 2001 From: Jonathan Golder Date: Thu, 27 Sep 2018 08:41:53 +0200 Subject: [PATCH] Do not raise Exception when image not exists Just output a warning and go on with further jobs --- euroexange/euroexange.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/euroexange/euroexange.py b/euroexange/euroexange.py index eae2d4a..9c54020 100644 --- a/euroexange/euroexange.py +++ b/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():