More precise error handling
This commit is contained in:
parent
adda405f83
commit
638a5c021c
@ -161,10 +161,11 @@ def run():
|
|||||||
source = os.path.abspath(entry["source"])
|
source = os.path.abspath(entry["source"])
|
||||||
destination = os.path.abspath(root_mount_point + entry["destination"])
|
destination = os.path.abspath(root_mount_point + entry["destination"])
|
||||||
|
|
||||||
if not os.path.isfile(source) or not os.path.isdir(destination):
|
if not os.path.isfile(source):
|
||||||
return ("Bad source or destination",
|
return ("Bad source", "source=\"{}\"".format(source))
|
||||||
"source=\"{}\"\ndestination=\"{}\"".format(source,
|
if not os.path.isdir(destination):
|
||||||
destination))
|
return ("Bad destination",
|
||||||
|
"destination=\"{}\"".format(destination))
|
||||||
|
|
||||||
unpack.append(UnpackEntry(source, destination))
|
unpack.append(UnpackEntry(source, destination))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user