diff --git a/bin/cdist b/bin/cdist index fde7a251..d9f88b48 100755 --- a/bin/cdist +++ b/bin/cdist @@ -181,9 +181,12 @@ class Cdist: if remote: remote_cat(script) else: - script_fd = open(script) - print(script_fd.read()) - script_fd.close() + try: + script_fd = open(script) + print(script_fd.read()) + script_fd.close() + except IOError as error: + raise CdistError(str(error)) raise CdistError("Command failed (shell): " + " ".join(*args)) except OSError as error: