]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Print error when user script fails
authorOlli Raula <olli.raula@relexsolutions.com>
Wed, 23 Feb 2022 07:25:54 +0000 (09:25 +0200)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Sun, 15 Jan 2023 14:08:07 +0000 (15:08 +0100)
autorandr.py

index 2919bb0c9f693a0aba9c2b6bbabac34710beaeae..217b2b44e859a9da48809365543149cb437bd674 100755 (executable)
@@ -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