Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
more detailed error
Browse files Browse the repository at this point in the history
  • Loading branch information
BlinkyStitt committed Nov 21, 2016
1 parent 3f4b476 commit 3135b4e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions joinmarket/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,13 @@ def queryHTTP(self, obj):
raise JsonRpcConnectionError(
"authentication for JSON-RPC failed")

# All of the codes below are 'fine' from a JSON-RPC point of view.
if response.status not in [200, 404, 500]:
conn.close()
raise JsonRpcConnectionError("unknown error in JSON-RPC")

data = response.read()
conn.close()

# All of the codes below are 'fine' from a JSON-RPC point of view.
if response.status not in [200, 404, 500]:
raise JsonRpcConnectionError("unknown error %s in JSON-RPC: %s" % (response.status, data))

return json.loads(data)

except JsonRpcConnectionError as exc:
Expand Down

0 comments on commit 3135b4e

Please sign in to comment.