def user_error(status_code, title, detail, pointer):
    """Create and return a general user error response that is jsonapi compliant.

    Required args:
        status_code: The HTTP status code associated with the problem.
        title: A short summary of the problem.
        detail: An explanation specific to the occurence of the problem.
        pointer: The request path associated with the source of the problem.
    """
    response = {
        'errors': [{
            'status': status_code,
            'source': {'pointer': '{0}'.format(pointer)},
            'title': title,
            'detail': detail,
        }],
        'jsonapi': {
            'version': '1.0'
        },
        'meta': {
            'sqlalchemy_jsonapi_version': __version__
        }
    }
    return json.dumps(response), status_code
Create and return a general user error response that is jsonapi compliant.

    Required args:
        status_code: The HTTP status code associated with the problem.
        title: A short summary of the problem.
        detail: An explanation specific to the occurence of the problem.
        pointer: The request path associated with the source of the problem.