@staticmethod<EOL><INDENT>def decode(response):<DEDENT>
<EOL>try:<EOL><INDENT>response.raise_for_status()<EOL><DEDENT>except requests.HTTPError as e:<EOL><INDENT>raise BackendException(code=response.status_code,<EOL>message=e,<EOL>response=response)<EOL><DEDENT>else:<EOL><INDENT>resp_json = response.json()<EOL>error = resp_json.get('<STR_LIT>', None)<EOL>if error:<EOL><INDENT>raise BackendException(code=error['<STR_LIT:code>'],<EOL>message=error['<STR_LIT:message>'],<EOL>response=response)<EOL><DEDENT>return resp_json<EOL><DEDENT>
Decodes and returns the response as JSON (dict) or raise BackendException
:param response: requests.response object
:return: dict