The lack of errno can cause unclear and long log output.
Issue can be triggered by:
0--- a/src/httpserver.cpp
1+++ b/src/httpserver.cpp
2@@ -263,6 +263,7 @@ std::string RequestMethodString(HTTPRequest::RequestMethod m)
3 /** HTTP request callback */
4 static void http_request_cb(struct evhttp_request* req, void* arg)
5 {
6+ throw std::runtime_error{"Hello"};
7 evhttp_connection* conn{evhttp_request_get_connection(req)};
8 // Track active requests
9 {
and running a functional test such as test/functional/feature_abortnode.py.
http.client.RemoteDisconnected not specifying errno to ConnectionResetError-ctor: https://github.com/python/cpython/blob/ce4b0ede16aea62ee7b1e02df7e1538102a356da/Lib/http/client.py#L1556C9-L1556C29
Log before
02025-11-14T20:53:05.272804Z TestFramework (ERROR): Unexpected exception
1Traceback (most recent call last):
2 File "/home/hodlinator/bc/3/test/functional/test_framework/test_framework.py", line 138, in main
3 self.setup()
4 ~~~~~~~~~~^^
5 File "/home/hodlinator/bc/3/test/functional/test_framework/test_framework.py", line 268, in setup
6 self.setup_network()
7 ~~~~~~~~~~~~~~~~~~^^
8 File "/home/hodlinator/bc/3/./build/test/functional/feature_abortnode.py", line 21, in setup_network
9 self.setup_nodes()
10 ~~~~~~~~~~~~~~~~^^
11 File "/home/hodlinator/bc/3/test/functional/test_framework/test_framework.py", line 381, in setup_nodes
12 self.start_nodes()
13 ~~~~~~~~~~~~~~~~^^
14 File "/home/hodlinator/bc/3/test/functional/test_framework/test_framework.py", line 527, in start_nodes
15 node.wait_for_rpc_connection()
16 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
17 File "/home/hodlinator/bc/3/test/functional/test_framework/test_node.py", line 326, in wait_for_rpc_connection
18 rpc.getblockcount()
19 ~~~~~~~~~~~~~~~~~^^
20 File "/home/hodlinator/bc/3/test/functional/test_framework/coverage.py", line 50, in __call__
21 return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
22 File "/home/hodlinator/bc/3/test/functional/test_framework/authproxy.py", line 137, in __call__
23 response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
24 ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 File "/home/hodlinator/bc/3/test/functional/test_framework/authproxy.py", line 111, in _request
26 return self._get_response()
27 ~~~~~~~~~~~~~~~~~~^^
28 File "/home/hodlinator/bc/3/test/functional/test_framework/authproxy.py", line 174, in _get_response
29 http_response = self.__conn.getresponse()
30 File "/nix/store/62fdlzq1x1ak2lsxp4ij7ip5k9nia3hc-python3-3.13.7/lib/python3.13/http/client.py", line 1430, in getresponse
31 response.begin()
32 ~~~~~~~~~~~~~~^^
33 File "/nix/store/62fdlzq1x1ak2lsxp4ij7ip5k9nia3hc-python3-3.13.7/lib/python3.13/http/client.py", line 331, in begin
34 version, status, reason = self._read_status()
35 ~~~~~~~~~~~~~~~~~^^
36 File "/nix/store/62fdlzq1x1ak2lsxp4ij7ip5k9nia3hc-python3-3.13.7/lib/python3.13/http/client.py", line 300, in _read_status
37 raise RemoteDisconnected("Remote end closed connection without"
38 " response")
39http.client.RemoteDisconnected: Remote end closed connection without response
Log after
02025-11-14T20:48:10.552126Z TestFramework (ERROR): Unexpected exception
1Traceback (most recent call last):
2 File "/home/hodlinator/bc/3/test/functional/test_framework/test_framework.py", line 138, in main
3 self.setup()
4 ~~~~~~~~~~^^
5 File "/home/hodlinator/bc/3/test/functional/test_framework/test_framework.py", line 268, in setup
6 self.setup_network()
7 ~~~~~~~~~~~~~~~~~~^^
8 File "/home/hodlinator/bc/3/./build/test/functional/feature_abortnode.py", line 21, in setup_network
9 self.setup_nodes()
10 ~~~~~~~~~~~~~~~~^^
11 File "/home/hodlinator/bc/3/test/functional/test_framework/test_framework.py", line 381, in setup_nodes
12 self.start_nodes()
13 ~~~~~~~~~~~~~~~~^^
14 File "/home/hodlinator/bc/3/test/functional/test_framework/test_framework.py", line 527, in start_nodes
15 node.wait_for_rpc_connection()
16 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
17 File "/home/hodlinator/bc/3/test/functional/test_framework/test_node.py", line 316, in wait_for_rpc_connection
18 raise FailedToStartError(self._node_msg(
19 f'bitcoind exited with status {self.process.returncode} during initialization. {str_error}'))
20test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status -6 during initialization. terminate called after throwing an instance of 'std::runtime_error'
21 what(): Hello
22************************
Note how even the C++ exception message is now included.