diff sat/core/exceptions.py @ 2793:181735d1b062

plugin mr mercurial, tools(common/utils): moved command protocol to a new module
author Goffi <goffi@goffi.org>
date Fri, 25 Jan 2019 09:06:29 +0100
parents e9cd473a2f46
children ab2696e34d29
line wrap: on
line diff
--- a/sat/core/exceptions.py	Tue Jan 22 18:52:16 2019 +0100
+++ b/sat/core/exceptions.py	Fri Jan 25 09:06:29 2019 +0100
@@ -126,3 +126,15 @@
 class InvalidCertificate(Exception):
     """A TLS certificate is not valid"""
     pass
+
+
+class CommandException(RuntimeError):
+    """An external command failed
+
+    stdout and stderr will be attached to the Exception
+    """
+
+    def __init__(self, msg, stdout, stderr):
+        super(CommandException, self).__init__(msg)
+        self.stdout = stdout
+        self.stderr = stderr