summaryrefslogtreecommitdiff
path: root/lbup/exceptions.py
blob: 69201efef83d2bb0bab33e97511bb3a36049eb29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class BackupException(Exception):
    pass

class RemoteExecException(BackupException):
    retcode = None
    output  = None
    def __init__(self, explanation, retcode, output):
        super().__init__(explanation)
        self.retcode = retcode
        self.output  = output

    def __str__(self):
        return (super().__str__() +
                ';%d: %s' % (self.retcode, self.output.decode('utf-8', errors = 'backslashreplace')))