Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

775 B
Raw Blame
from rest_framework import status
from rest_framework.exceptions import APIException


class SearchUnavailable(APIException):
    """Search cannot answer because of database errors a retry may clear
    (unreachable, timed out, locked) or an unusable connection. The client
    may retry; never "no matches".
    """

    status_code = status.HTTP_503_SERVICE_UNAVAILABLE
    default_detail = "Search is temporarily unavailable."
    default_code = "search_unavailable"


class SearchFailed(APIException):
    """Every searched type failed, and not all with retryable database
    errors -- most likely a bug, so retrying will not help.
    """

    status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
    default_detail = "Search failed."
    default_code = "search_failed"