wikipedia: catch all filthy exceptions

This commit is contained in:
dece 2021-06-11 11:31:45 +02:00
parent 5ca4a25b1f
commit b7b6ca71be

View file

@ -40,7 +40,7 @@ class WikipediaPlugin(Plugin):
try:
summary = wikipedia.summary(wikipedia.random(), sentences=1)
break
except wikipedia.exceptions.WikipediaException:
except: # The wikipedia package can raise a lot of different stuff.
pass
retries -= 1
if summary:
@ -59,7 +59,7 @@ class WikipediaPlugin(Plugin):
except wikipedia.exceptions.PageError:
summary = self.config["empty_response"]
break
except wikipedia.exceptions.WikipediaException:
except:
summary = self.bot.config["error_message"]
# Keep trying after a slight delay.
time.sleep(1)