diff --git a/get_def.py b/get_def.py index 0facc35..29368a2 100644 --- a/get_def.py +++ b/get_def.py @@ -30,6 +30,9 @@ def main(): response = requests.get(word_url, timeout=60) + if response.status_code == 404: + exit("Sorry, we couldn't find definitions for the word you were looking for.") + word = response.json()[0].get("word") phonetics = response.json()[0].get("phonetics") @@ -56,8 +59,6 @@ def main(): console = Console(width=100) print() - console.rule() - print() print(" :arrow_forward: ", Text(word, style="bold red", justify="center")) print() diff --git a/pyproject.toml b/pyproject.toml index fbceeaf..c45e8fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "get-def" -version = "0.1" +version = "0.2" authors = [ { name="Jeffrey Serio", email="hyperreal@fedoraproject.org" }, ]