mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-02 09:46:14 +00:00
tests: log node JSON-RPC errors during test setup
Currently, if the node replies to any command with an error during the test framework's setup(), we log the generic and not really useful "Unexpected exception" from the BaseException catch, with no further information. This isn't helpful for diagnosing the issue. Fix it by explicitly handling JSONRPCException and logging the response error message and http status code.
This commit is contained in:
parent
45930a7941
commit
6354b4fd7f
@ -147,6 +147,9 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
except subprocess.CalledProcessError as e:
|
||||
self.log.exception(f"Called Process failed with stdout='{e.stdout}'; stderr='{e.stderr}';")
|
||||
self.success = TestStatus.FAILED
|
||||
except JSONRPCException as e:
|
||||
self.log.exception(f"Failure during setup: error={e.error}, http_status={e.http_status}")
|
||||
self.success = TestStatus.FAILED
|
||||
except BaseException:
|
||||
self.log.exception("Unexpected exception")
|
||||
self.success = TestStatus.FAILED
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user