From 638a5c021cc5435919e38a31c218895472c9f271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Wed, 30 Jul 2014 15:05:44 +0200 Subject: [PATCH] More precise error handling --- src/modules/unsquashfs/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/unsquashfs/main.py b/src/modules/unsquashfs/main.py index b5664cb49..ededb216d 100644 --- a/src/modules/unsquashfs/main.py +++ b/src/modules/unsquashfs/main.py @@ -161,10 +161,11 @@ def run(): source = os.path.abspath(entry["source"]) destination = os.path.abspath(root_mount_point + entry["destination"]) - if not os.path.isfile(source) or not os.path.isdir(destination): - return ("Bad source or destination", - "source=\"{}\"\ndestination=\"{}\"".format(source, - destination)) + if not os.path.isfile(source): + return ("Bad source", "source=\"{}\"".format(source)) + if not os.path.isdir(destination): + return ("Bad destination", + "destination=\"{}\"".format(destination)) unpack.append(UnpackEntry(source, destination))