From b96fc7219555d80e03200b978601946eda8a66c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Wed, 3 Aug 2005 17:06:41 +0000 Subject: [PATCH] more on exception handling. FIXES: bug #334 --- pisi/toplevel.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pisi/toplevel.py b/pisi/toplevel.py index f76f1457..ae75e138 100644 --- a/pisi/toplevel.py +++ b/pisi/toplevel.py @@ -28,15 +28,27 @@ from index import Index def install(packages): """install a list of packages (either files/urls, or names)""" - # determine if this is a list of files/urls or names + + # FIXME: this function name "install" makes impossible to import + # and use install module directly. + from install import InstallError + try: + # determine if this is a list of files/urls or names if packages[0].endswith(const.package_prefix): # they all have to! install_pkg_files(packages) else: install_pkg_names(packages) + + except InstallError, e: + ui.error("%s\n" % e) + except packagedb.PackageDBError, e: ui.error("PackageDBError: (%s)\n" % e) ui.error("Package is not installable. Its very likely a dependency problem.\n") + + except Exception, e: + ui.error("Error: %e\n" % e) def install_pkg_files(packages):