# Path: ricloud/utils.py
# def encode_json(data, indent=None):
#     return json.dumps(data, indent=indent, cls=DataEncoder, ensure_ascii=False)
# 
# def decode_json(data):
#     return json.loads(data, object_pairs_hook=OrderedDict)


from ricloud.utils import encode_json, decode_json
from __future__ import absolute_import



class RicloudError(Exception):
    def __init__(self, status, content):
        self.status = status
        self.content = content

    def __repr__(self):
        return "RequestError(status={s.status}, content='{s.content}')".format(s=self)

    def __str__(self):
        return "status:{s.status}, content:{s.content}".format(s=self)


class RequestError(RicloudError):
    """Error response returned from the API."""

    def __init__(self, status, content):
        super(RequestError, self).__init__(status, content)

        self.error, self.message, self.params = self.parse_content(content)

    @staticmethod
    def parse_content(content):

# Path: ricloud/utils.py
# def encode_json(data, indent=None):
#     return json.dumps(data, indent=indent, cls=DataEncoder, ensure_ascii=False)
# 
# def decode_json(data):
#     return json.loads(data, object_pairs_hook=OrderedDict)


# Path: ricloud/exceptions.py
from ricloud.utils import encode_json, decode_json

from __future__ import absolute_import



class RicloudError(Exception):
    def __init__(self, status, content):
        self.status = status
        self.content = content

    def __repr__(self):
        return "RequestError(status={s.status}, content='{s.content}')".format(s=self)

    def __str__(self):
        return "status:{s.status}, content:{s.content}".format(s=self)


class RequestError(RicloudError):
    """Error response returned from the API."""

    def __init__(self, status, content):
        super(RequestError, self).__init__(status, content)

        self.error, self.message, self.params = self.parse_content(content)

    @staticmethod
    def parse_content(content):

        data = decode_json(content)