mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 05:32:22 +02:00
test: Map cli CalledProcessError on server error to JSONRPCException
Like authproxy.py, so that tests can work without having to think whether the cli was used or not.
This commit is contained in:
@@ -967,6 +967,13 @@ class TestNodeCLI():
|
||||
if match:
|
||||
code, message = match.groups()
|
||||
raise JSONRPCException(dict(code=int(code), message=message))
|
||||
match = re.match(r'error: Server response: (.*)\n?$', cli_stderr)
|
||||
if match:
|
||||
message = match.group(1)
|
||||
raise JSONRPCException(dict(
|
||||
code=-342,
|
||||
message=f"non-JSON HTTP response with '503 Service Unavailable' from server: {message}",
|
||||
), http_status=503)
|
||||
# Ignore cli_stdout, raise with cli_stderr
|
||||
raise subprocess.CalledProcessError(returncode, p_args, output=cli_stderr)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user