From 5992ab1c721d82b90af0e26c7a907f196bcf8dd1 Mon Sep 17 00:00:00 2001 From: behlec <33778676+behlec@users.noreply.github.com> Date: Thu, 7 Dec 2017 20:31:24 +0100 Subject: Improve error handling when failing to execute program. (#2743) --- mesonbuild/scripts/commandrunner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mesonbuild/scripts/commandrunner.py b/mesonbuild/scripts/commandrunner.py index f99cddb..fdca7cd 100644 --- a/mesonbuild/scripts/commandrunner.py +++ b/mesonbuild/scripts/commandrunner.py @@ -38,7 +38,10 @@ def run_command(source_dir, build_dir, subdir, meson_command, command, arguments try: return subprocess.Popen(command_array, env=child_env, cwd=cwd) except FileNotFoundError: - print('Could not execute command "%s".' % command) + print('Could not execute command "%s". File not found.' % command) + sys.exit(1) + except PermissionError: + print('Could not execute command "%s". File not executable.' % command) sys.exit(1) def run(args): -- cgit v1.1