rest: print also HTTP response reason in case of an error

This commit is contained in:
Roman Zeyde
2025-12-16 23:13:48 +01:00
parent 7fe94a0493
commit 59b93f11e8

View File

@@ -84,7 +84,7 @@ class RESTTest (BitcoinTestFramework):
conn.request('POST', rest_uri, body)
resp = conn.getresponse()
assert resp.status == status, f"Expected: {status}, Got: {resp.status} - Response: {str(resp.read())}"
assert resp.status == status, f"Expected: {status}, Got: {resp.status} ({resp.reason}) - Response: {str(resp.read())}"
if ret_type == RetType.OBJ:
return resp