wikipedia: catch all filthy exceptions
This commit is contained in:
parent
5ca4a25b1f
commit
b7b6ca71be
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue