Serializer for native falcon HTTPError exceptions.

        We override the default serializer with our own so we
        can ensure the errors are serialized in a JSON API
        compliant format.

        Surprisingly, most falcon error attributes map directly
        to the JSON API spec. The few that don't can be mapped
        accordingly:


            HTTPError               JSON API
            ~~~~~~~~~               ~~~~~~~~

            exc.description    ->   error['detail']
            exc.link['href']   ->   error['links']['about']


        Per the falcon docs this function should return a tuple
        of (MIMETYPE, BODY PAYLOAD)

def _error_serializer(req, exc):  # pylint: disable=unused-argument
        """ Serializer for native falcon HTTPError exceptions.

        We override the default serializer with our own so we
        can ensure the errors are serialized in a JSON API
        compliant format.

        Surprisingly, most falcon error attributes map directly
        to the JSON API spec. The few that don't can be mapped
        accordingly:


            HTTPError               JSON API
            ~~~~~~~~~               ~~~~~~~~

            exc.description    ->   error['detail']
            exc.link['href']   ->   error['links']['about']


        Per the falcon docs this function should return a tuple
        of (MIMETYPE, BODY PAYLOAD)
        """

        error = {
            'detail': exc.description,
            'title': exc.title,
            'status': exc.status,
        }

        try:
            error['links'] = {'about': exc.link['href']}
        except (TypeError, KeyError):
            error['links'] = {'about': ''}

        return (
            goldman.config.JSONAPI_MIMETYPE,
            json.dumps({'errors': [error]}),
        )