Mercurial > python-hglib
annotate hglib/error.py @ 224:2ab42323f149
client: handle commit messages with \0 characters for all commands
Each of the impacted commands will now use the 'json' template,
which they all support as of Mercurial 3.7.3 (the first version
tested in the regression tests).
Note: I tried to add a test with null bytes,
but both hglib and using hg directly through subprocess
rejected adding a commit message with a null byte.
author | Mathias De Mare <mathias.de_mare@nokia.com> |
---|---|
date | Mon, 13 Mar 2023 15:32:20 +0100 |
parents | 59cb26bf866e |
children |
rev | line source |
---|---|
0 | 1 class CommandError(Exception): |
2 def __init__(self, args, ret, out, err): | |
3 self.args = args | |
4 self.ret = ret | |
5 self.out = out | |
6 self.err = err | |
7 | |
36
00bb0701323a
error: return stderr as __str__ for CommandError
Idan Kamara <idankk86@gmail.com>
parents:
0
diff
changeset
|
8 def __str__(self): |
117
59cb26bf866e
error: show more info on CommandError's __str__
Idan Kamara <idankk86@gmail.com>
parents:
36
diff
changeset
|
9 return str((self.ret, self.out.rstrip(), self.err.rstrip())) |
36
00bb0701323a
error: return stderr as __str__ for CommandError
Idan Kamara <idankk86@gmail.com>
parents:
0
diff
changeset
|
10 |
0 | 11 class ServerError(Exception): |
12 pass | |
13 | |
14 class ResponseError(ServerError, ValueError): | |
15 pass | |
16 | |
17 class CapabilityError(ServerError): | |
18 pass |