```
feat: 添加飞书用户模块和订阅功能支持 - 新增feishu_users模块用于处理飞书用户身份验证和权限管理 - 新增subscriptions模块用于处理订阅相关功能 - 新增personalization模块用于个性化服务 - 在alembic迁移配置中注册新的模型模块 - 在API路由器中添加feishu_users和subscriptions路由 - 实现事件调度服务的改进,包括错误处理和状态更新优化 - 添加飞书命令处理的权限检查机制 - 实现飞书应用票据事件处理 - 改进审计日志记录功能 ```
This commit is contained in:
29
app/modules/feishu/errors.py
Normal file
29
app/modules/feishu/errors.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from typing import Any
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
|
||||
class FeishuAPIError(HTTPException):
|
||||
"""Normalized outbound Feishu failure with retry classification."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
detail: str,
|
||||
*,
|
||||
retryable: bool,
|
||||
http_status: int | None = None,
|
||||
provider_code: int | str | None = None,
|
||||
provider_response: dict[str, Any] | None = None,
|
||||
) -> None:
|
||||
super().__init__(
|
||||
status_code=(
|
||||
status.HTTP_503_SERVICE_UNAVAILABLE
|
||||
if retryable
|
||||
else status.HTTP_502_BAD_GATEWAY
|
||||
),
|
||||
detail=detail,
|
||||
)
|
||||
self.retryable = retryable
|
||||
self.http_status = http_status
|
||||
self.provider_code = provider_code
|
||||
self.provider_response = provider_response or {}
|
||||
Reference in New Issue
Block a user