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


from http import HTTPStatus
from .encoder import json_dumps
        return result


class ErrorList(Exception):
    """
    Exception contains list of errors.

    Can be used to store a list of exceptions, which occur during the
    execution of a request.

    :seealso: http://jsonapi.org/format/#error-objects
    :seealso: http://jsonapi.org/examples/#error-objects-multiple-errors
    """

    def __init__(self, errors=None):
        """Error list initializer."""
        self.errors = list()
        if errors:
            self.extend(errors)

    def __bool__(self):
        """Return True if errors are exists."""
        return bool(self.errors)

    def __len__(self):
        """Return count of errors."""
        return len(self.errors)

    def __str__(self):
        """Return string representation of errors list."""

# 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

        return result


class ErrorList(Exception):
    """
    Exception contains list of errors.

    Can be used to store a list of exceptions, which occur during the
    execution of a request.

    :seealso: http://jsonapi.org/format/#error-objects
    :seealso: http://jsonapi.org/examples/#error-objects-multiple-errors
    """

    def __init__(self, errors=None):
        """Error list initializer."""
        self.errors = list()
        if errors:
            self.extend(errors)

    def __bool__(self):
        """Return True if errors are exists."""
        return bool(self.errors)

    def __len__(self):
        """Return count of errors."""
        return len(self.errors)

    def __str__(self):
        """Return string representation of errors list."""

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