CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-ariadne

Ariadne is a Python library for implementing GraphQL servers using a schema-first approach.

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

error-handling.mddocs/

Error Handling

Functions for formatting GraphQL errors and extracting error information for client responses.

Capabilities

Error Formatting

def format_error(error: Exception, debug: bool = False) -> dict:
    """
    Format GraphQL error for client response.
    
    Parameters:
    - error: Exception to format
    - debug: Include debug information
    
    Returns:
    Formatted error dict with message, locations, path
    """

def get_error_extension(error: Exception) -> Optional[dict]:
    """Extract extension data from error."""

def get_formatted_error_context(error: dict) -> Optional[Any]:
    """Get context information from formatted error."""

def get_formatted_error_traceback(error: dict) -> Optional[str]:
    """Get traceback from formatted error."""

def unwrap_graphql_error(error: Exception) -> Exception:
    """Unwrap GraphQL error to get original exception."""

Usage Examples

from ariadne import format_error

# Custom error formatting
def custom_error_formatter(error, debug=False):
    formatted = format_error(error, debug)
    formatted["timestamp"] = datetime.now().isoformat()
    return formatted

Install with Tessl CLI

npx tessl i tessl/pypi-ariadne

docs

asgi.md

core-schema.md

error-handling.md

execution.md

explorer.md

federation.md

file-uploads.md

index.md

relay.md

resolvers.md

type-bindables.md

validation.md

tile.json