view hglib/error.py @ 201:67398bbf788d 2.6

client: do not accept NULL character as command arguments It would break the data structure, and it's also invalid as a shell command.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 25 Apr 2018 21:27:02 +0900
parents 59cb26bf866e
children
line wrap: on
line source

class CommandError(Exception):
    def __init__(self, args, ret, out, err):
        self.args = args
        self.ret = ret
        self.out = out
        self.err = err

    def __str__(self):
        return str((self.ret, self.out.rstrip(), self.err.rstrip()))

class ServerError(Exception):
    pass

class ResponseError(ServerError, ValueError):
    pass

class CapabilityError(ServerError):
    pass