MCPcopy Create free account
hub / github.com/HisMax/RedInk / log_error

Function log_error

backend/routes/utils.py:43–54  ·  view source on GitHub ↗

记录 API 错误日志 Args: endpoint: API 端点路径 error: 异常对象

(endpoint: str, error: Exception)

Source from the content-addressed store, hash-verified

41
42
43def log_error(endpoint: str, error: Exception):
44 """
45 记录 API 错误日志
46
47 Args:
48 endpoint: API 端点路径
49 error: 异常对象
50 """
51 logger.error(f"❌ 请求失败: {endpoint}")
52 logger.error(f" 错误类型: {type(error).__name__}")
53 logger.error(f" 错误信息: {str(error)}")
54 logger.debug(f" 堆栈跟踪:\n{traceback.format_exc()}")
55
56
57def api_error_response(error, status: int = None, context: dict = None):

Callers 7

generate_imagesFunction · 0.85
get_imageFunction · 0.85
retry_single_imageFunction · 0.85
retry_failed_imagesFunction · 0.85
regenerate_imageFunction · 0.85
generate_contentFunction · 0.85
generate_outlineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected