From 1ab53d32f484d34ddad7f2ce9de6acae596fb2e8 Mon Sep 17 00:00:00 2001 From: Antonio Lopez Rivera Date: Sat, 24 Jul 2021 02:57:47 +0200 Subject: [PATCH] CLI: file not found error handling --- anchorage/cli.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/anchorage/cli.py b/anchorage/cli.py index e707c87..11d0dc2 100644 --- a/anchorage/cli.py +++ b/anchorage/cli.py @@ -98,7 +98,14 @@ def main(): }] browser = prompt(brow_choice, style=style)['browser'] - bmk_dict = load(path(browser)) + try: + bmk_dict = load(path(browser)) + except FileNotFoundError: + smart_print_color("\n ~Error: file not found.", "red") + smart_print_color("\n ~Edit ~/anchorage/config.toml to include the correct bookmark file path " + "for your browser and try again.", "red") + sys.exit() + newline() # 3. Bookmark filter