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