Rely on presence of 'error' element to detect errors.
This commit is contained in:
parent
35cc9e035d
commit
412a04b16b
|
@ -57,11 +57,10 @@ class Client(object):
|
|||
class ErrorHandler(object):
|
||||
@staticmethod
|
||||
def _handle_error(resp):
|
||||
error_state = resp['@error']
|
||||
if error_state == 'false':
|
||||
error = resp.get('error')
|
||||
if not error:
|
||||
return
|
||||
|
||||
error = resp['error']
|
||||
code = error['code']
|
||||
msg = error['msg']
|
||||
template = 'Error {code}: {msg}'
|
||||
|
|
Loading…
Reference in New Issue
Block a user