def parse_error(self, result): return json.loads(result)['error']
def parse_response(self, result, headers): try: result = json.loads(result or '{}') except: raise APIFormatError('Unable to process JSON data: %s' % str(result)[:200]) return result