Correctly handle a 404 in thesaurus.py

This commit is contained in:
jesopo 2018-12-16 11:03:36 +00:00
parent 00ac4d208a
commit 28900c2ff9

View file

@ -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():