# Path: aiohttp_json_api/encoder.py
# class JSONEncoder(json.JSONEncoder):
#     def default(self, o):


from http import HTTPStatus
from .encoder import json_dumps
        :param title:
            A short, human-readable summay of the problem that
            SHOULD not change from occurrence to occurrence of the problem,
            except for purposes of localization.
            The default value is the class name.
        :param detail:
            A human-readable explanation specific to this occurrence
            of the problem.
        :param source_parameter:
            A string indicating which URI query parameter caused the error.
        :param source_pointer:
            A JSON Pointer [RFC6901] to the associated entity in the request
            document [e.g. `"/data"` for a primary data object, or
            `"/data/attributes/title"` for a specific attribute].
        :param meta:
            A meta object containing non-standard meta-information
            about the error.
        """
        super(Error, self).__init__()
        self.id = id_
        self.about = about
        self.code = code
        self.title = title if title is not None else self.status.phrase
        self.detail = detail if detail else self.status.description
        self.source_pointer = source_pointer
        self.source_parameter = source_parameter
        self.meta = meta if meta is not None else dict()

    def __str__(self):
        """Return the :attr:`detail` attribute per default."""

# Path: aiohttp_json_api/encoder.py
# class JSONEncoder(json.JSONEncoder):
#     def default(self, o):


# Path: aiohttp_json_api/errors.py
from http import HTTPStatus
from .encoder import json_dumps

        :param title:
            A short, human-readable summay of the problem that
            SHOULD not change from occurrence to occurrence of the problem,
            except for purposes of localization.
            The default value is the class name.
        :param detail:
            A human-readable explanation specific to this occurrence
            of the problem.
        :param source_parameter:
            A string indicating which URI query parameter caused the error.
        :param source_pointer:
            A JSON Pointer [RFC6901] to the associated entity in the request
            document [e.g. `"/data"` for a primary data object, or
            `"/data/attributes/title"` for a specific attribute].
        :param meta:
            A meta object containing non-standard meta-information
            about the error.
        """
        super(Error, self).__init__()
        self.id = id_
        self.about = about
        self.code = code
        self.title = title if title is not None else self.status.phrase
        self.detail = detail if detail else self.status.description
        self.source_pointer = source_pointer
        self.source_parameter = source_parameter
        self.meta = meta if meta is not None else dict()

    def __str__(self):
        """Return the :attr:`detail` attribute per default."""

        return json_dumps(self.as_dict, indent=4, sort_keys=True)