From 22e6ff62931ff4388ab4bfc4abb52d9785c68e3b Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 3 Jan 2022 16:42:46 +0000 Subject: added error checking for install --- src/verbs/install.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/verbs/install.py b/src/verbs/install.py index 3ddd88c..60e1809 100644 --- a/src/verbs/install.py +++ b/src/verbs/install.py @@ -321,8 +321,13 @@ def install(args, options, config): if util.ask_confirmation(colors.BLUE + "Continue?", no_confirm=options["y"]): for package in to_install: - install_single(package, options, config, verbose=v, unsafe=unsafe) - util.fill_line(f"Installed {package}", colors.BG_CYAN + colors.LIGHT_BLACK, end="\n") + try: + install_single(package, options, config, verbose=v, unsafe=unsafe) + util.fill_line(f"Installed {package}", colors.BG_CYAN + colors.LIGHT_BLACK, end="\n") + except Exception as e: + util.fill_line(f"Failed to install {package}", colors.BG_RED + colors.LIGHT_BLACK, end="\n") + util.fill_line(str(e), colors.CLEAR_LINE + colors.RESET + colors.RED, end="\n") + else: print(colors.RED + "Action cancelled by user") -- cgit v1.2.1