Correctly handle a 404 in thesaurus.py
This commit is contained in:
parent
00ac4d208a
commit
28900c2ff9
1 changed files with 3 additions and 0 deletions
|
@ -16,6 +16,9 @@ class Module(ModuleManager.BaseModule):
|
||||||
"bighugethesaurus-api-key"], phrase), json=True)
|
"bighugethesaurus-api-key"], phrase), json=True)
|
||||||
syn_ant = event["command"][:3]
|
syn_ant = event["command"][:3]
|
||||||
if page:
|
if page:
|
||||||
|
if page.code == 404:
|
||||||
|
raise utils.EventError("Word not found")
|
||||||
|
|
||||||
if not len(event["args_split"]) > 1:
|
if not len(event["args_split"]) > 1:
|
||||||
word_types = []
|
word_types = []
|
||||||
for word_type in page.data.keys():
|
for word_type in page.data.keys():
|
||||||
|
|
Loading…
Reference in a new issue