Skip to content

Commit

Permalink
add more exception information. close #73
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaocong committed Sep 28, 2014
1 parent c3b6844 commit 6f52c6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion uiautomator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ def __call__(self, *args, **kwargs):
if result is not None:
result.close()
if "error" in jsonresult and jsonresult["error"]:
raise JsonRPCError(jsonresult["error"]["code"], jsonresult["error"]["message"])
raise JsonRPCError(
jsonresult["error"]["code"],
"%s: %s" % (jsonresult["error"]["data"]["exceptionTypeName"], jsonresult["error"]["message"])
)
return jsonresult["result"]

def id(self):
Expand Down

0 comments on commit 6f52c6a

Please sign in to comment.