Print error when user script fails

This commit is contained in:
Olli Raula 2022-02-23 09:25:54 +02:00 committed by Phillip Berndt
parent 1d896af332
commit b8eb298a22

View File

@ -1185,8 +1185,8 @@ def exec_scripts(profile_path, script_name, meta_information=None):
if os.access(script, os.X_OK | os.F_OK):
try:
all_ok &= subprocess.call(script, env=env) != 0
except:
raise AutorandrException("Failed to execute user command: %s" % (script,))
except Exception as e:
raise AutorandrException("Failed to execute user command: %s error: %s" % (script,str(e)))
ran_scripts.add(script_name)
script_folder = os.path.join(folder, "%s.d" % script_name)
@ -1198,8 +1198,8 @@ def exec_scripts(profile_path, script_name, meta_information=None):
if os.access(script, os.X_OK | os.F_OK):
try:
all_ok &= subprocess.call(script, env=env) != 0
except:
raise AutorandrException("Failed to execute user command: %s" % (script,))
except Exception as e:
raise AutorandrException("Failed to execute user command: %s error: %s" % (script,str(e)))
ran_scripts.add(check_name)
return all_ok