test: include response body in non-JSON HTTP error msg

Useful for debugging issues.

Co-authored-by: Matias Furszyfer <matiasfurszyfer@protonmail.com>
This commit is contained in:
Matthew Zipkin
2026-02-10 17:00:49 -05:00
committed by furszy
parent 9dc653b3b4
commit 408d5b12e8

View File

@@ -191,7 +191,7 @@ class AuthServiceProxy():
content_type = http_response.getheader('Content-Type')
if content_type != 'application/json':
raise JSONRPCException(
{'code': -342, 'message': 'non-JSON HTTP response with \'%i %s\' from server' % (http_response.status, http_response.reason)},
{'code': -342, 'message': f"non-JSON HTTP response with \'{http_response.status} {http_response.reason}\' from server: {http_response.read().decode()}"},
http_response.status)
data = http_response.read()