Skip to content

Commit

Permalink
Fix error handling in client.post
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Dec 20, 2018
1 parent df53898 commit 7f9e8aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/aria2p/client.py
Expand Up @@ -145,7 +145,7 @@ def post(self, payload):
response = requests.post(self.server, data=payload).json()
if "result" in response:
return response["result"]
raise JSONRPCError(response["code"], response["message"])
raise JSONRPCError(response["error"]["code"], response["error"]["message"])

@staticmethod
def get_payload(method, params=None, msg_id=None, as_json=True):
Expand Down

0 comments on commit 7f9e8aa

Please sign in to comment.