feat: integrate web terminal interface with xtermjs support
feat: add basic version control functionality using minigit refactor: update context management and system message refresh maintenance: update pyproject.toml version to 1.59.0 fix: handle api connection errors more gracefully feat: add directory context tool
This commit is contained in:
+18
-6
@@ -50,12 +50,24 @@ def call_api(
|
||||
)
|
||||
if response.get("error"):
|
||||
if "status" in response:
|
||||
logger.error(f"API HTTP Error: {response['status']} - {response.get('text', '')}")
|
||||
logger.debug("=== API CALL FAILED ===")
|
||||
return {
|
||||
"error": f"API Error: {response['status']}",
|
||||
"message": response.get("text", ""),
|
||||
}
|
||||
status = response['status']
|
||||
text = response.get('text', '')
|
||||
exception_msg = response.get('exception', '')
|
||||
|
||||
if status == 0:
|
||||
error_msg = f"Network/Connection Error: {exception_msg or 'Unable to connect to API server'}"
|
||||
if not exception_msg and not text:
|
||||
error_msg += f". Check if API URL is correct: {api_url}"
|
||||
logger.error(f"API Connection Error: {error_msg}")
|
||||
logger.debug("=== API CALL FAILED ===")
|
||||
return {"error": error_msg}
|
||||
else:
|
||||
logger.error(f"API HTTP Error: {status} - {text}")
|
||||
logger.debug("=== API CALL FAILED ===")
|
||||
return {
|
||||
"error": f"API Error {status}: {text or 'No response text'}",
|
||||
"message": text,
|
||||
}
|
||||
else:
|
||||
logger.error(f"API call failed: {response.get('exception', 'Unknown error')}")
|
||||
logger.debug("=== API CALL FAILED ===")
|
||||
|
||||
Reference in New Issue
Block a user