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:
1 parent
9dc653b3b4
commit
408d5b12e8
1 file changed
+1
-1
@@ -191,7 +191,7 @@ class AuthServiceProxy():
|
|||||||
content_type = http_response.getheader('Content-Type')
|
content_type = http_response.getheader('Content-Type')
|
||||||
if content_type != 'application/json':
|
if content_type != 'application/json':
|
||||||
raise JSONRPCException(
|
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)
|
http_response.status)
|
||||||
|
|
||||||
data = http_response.read()
|
data = http_response.read()
|
||||||
|
|||||||
Reference in new issue
Block a user