graphql/error/format_error.py
def format_error(error: "GraphQLError") -> dict:
    """Format a GraphQL error

    Given a GraphQLError, format it according to the rules described by the "Response
    Format, Errors" section of the GraphQL Specification.
    """
    if not error:
        raise ValueError("Received null or undefined error.")
    formatted: Dict[str, Any] = dict(  # noqa: E701 (pycqa/flake8#394)
        message=error.message or "An unknown error occurred.",
        locations=error.locations,
        path=error.path,
    )
    if error.extensions:
        formatted.update(extensions=error.extensions)
    return formatted
Format a GraphQL error

    Given a GraphQLError, format it according to the rules described by the "Response
    Format, Errors" section of the GraphQL Specification.
    
Format a GraphQL error
Given a GraphQLError, format it according to the rules described by the "Response
Format, Errors" section of the GraphQL Specification.
Format a GraphQL error Given a GraphQLError format it according to the rules described by the " Response Format Errors " section of the GraphQL Specification .
def format_error(error: "GraphQLError") -> dict:
    if not error:
        raise ValueError("Received null or undefined error.")
    formatted: Dict[str, Any] = dict(  
        message=error.message or "An unknown error occurred.",
        locations=error.locations,
        path=error.path,
    )
    if error.extensions:
        formatted.update(extensions=error.extensions)
    return formatted
def format_error ( error : "GraphQLError" ) -> dict : if not error : raise ValueError ( "Received null or undefined error." ) formatted : Dict [ str , Any ] = dict ( message = error . message or "An unknown error occurred." , locations = error . locations , path = error . path , ) if error . extensions : formatted . update ( extensions = error . extensions ) return formatted
Format a GraphQL error
Given a GraphQLError, format it according to the rules described by the "Response
Format, Errors" section of the GraphQL Specification.
Format a GraphQL error Given a GraphQLError format it according to the rules described by the " Response Format Errors " section of the GraphQL Specification .
"""Format a GraphQL error

    Given a GraphQLError, format it according to the rules described by the "Response
    Format, Errors" section of the GraphQL Specification.
    """ # noqa: E701 (pycqa/flake8#394)
error
"GraphQLError"