MCPcopy Create free account
hub / github.com/bojieli/ai-agent-projects / APIError

Class APIError

deep-research/utils/api_error_handler.py:9–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7logger = logging.getLogger(__name__)
8
9class APIError(Exception):
10 def __init__(self, message: str, status_code: Optional[int] = None, response_body: Optional[str] = None):
11 self.message = message
12 self.status_code = status_code
13 self.response_body = response_body
14 super().__init__(self.message)
15
16def handle_openai_error(e: OpenAIError) -> APIError:
17 """Handle OpenAI API errors with detailed logging"""

Callers 3

_get_plan_from_llmMethod · 0.90
handle_openai_errorFunction · 0.85
handle_request_errorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected