Skip to content

Commit

Permalink
Handle lookup error on add command
Browse files Browse the repository at this point in the history
  • Loading branch information
yankeexe committed Feb 12, 2022
1 parent 8061a3d commit 7f6a91b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

setuptools.setup(
name="timezones_cli",
version="0.3.0",
version="0.3.1",
author="Yankee Maharjan",
url="https://github.com/yankeexe/timezones-cli",
description="Get local datetime from multiple timezones!",
Expand Down
8 changes: 7 additions & 1 deletion timezones_cli/commands/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ def add(query: str):
added_timezones = []
existing_timezones = []
line_break = "\n"
timezones = query_handler(query)

try:
timezones = query_handler(query)
except LookupError:
return console.print(
"Couldn't resolve your query, please try other keywords.:x:"
)

if len(timezones) > 1:
timezones = handle_interaction(timezones)
Expand Down

0 comments on commit 7f6a91b

Please sign in to comment.