Fix - add exception handling

This commit is contained in:
Petr Kalis 2021-11-05 14:19:56 +01:00
parent 0a9d2cde7f
commit 3872b3909e

View file

@ -305,12 +305,19 @@ def run_disk_mapping_commands(mongo_url):
args)
raise RuntimeError(exc_msg)
except TypeError:
_print("Error in mapping drive")
except TypeError as exc:
_print("Error {} in mapping drive {}, {}".format(str(exc),
source,
destination))
raise
else:
_print("disk mapping {}->{}".format(source, destination))
if not os.path.exists(destination):
os.symlink(source, destination)
try:
os.symlink(source, destination)
except OSError as exc:
_print("Error {} in mapping drive {}, {}".format(
str(exc), source, destination))
else:
_print("Destination {} already exists".format(destination))