Mediawiki: display an error when the article doesn't exist
This commit is contained in:
parent
880b2950d3
commit
8b819f097d
@ -23,7 +23,10 @@ def get_raw_page(site, term, ssl=False):
|
||||
data = json.loads(raw.read().decode())
|
||||
|
||||
for k in data["query"]["pages"]:
|
||||
try:
|
||||
return data["query"]["pages"][k]["revisions"][0]["*"]
|
||||
except:
|
||||
raise IRCException("article not found")
|
||||
|
||||
def get_unwikitextified(site, wikitext, ssl=False):
|
||||
# Built IRL
|
||||
|
Loading…
Reference in New Issue
Block a user