Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

获取章节任务点有概率报错KeyError: 'data' #148

Open
DR-lin-eng opened this issue May 12, 2024 · 0 comments
Open

获取章节任务点有概率报错KeyError: 'data' #148

DR-lin-eng opened this issue May 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@DR-lin-eng
Copy link

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /app/main.py:372 in │
│ │
│ 369 │ │ for task_obj in ClassSelector(command, classes): │
│ 370 │ │ │ # 章节容器 执行章节任务 │
│ 371 │ │ │ if isinstance(task_obj, ChapterContainer): │
│ ❱ 372 │ │ │ │ fuck_task_worker(task_obj) │
│ 373 │ │ │ │
│ 374 │ │ │ # 考试对象 执行考试任务 │
│ 375 │ │ │ elif isinstance(task_obj, ExamDto): │
│ │
│ /app/main.py:162 in fuck_task_worker │
│ │
│ 159 │ │ │ │ continue │
│ 160 │ │ │ refresh_flag = True │
│ 161 │ │ │ # 获取当前章节的所有任务点, 并遍历 │
│ ❱ 162 │ │ │ for task_point in chap[index]: │
│ 163 │ │ │ │ # 拉取任务卡片 Attachment │
│ 164 │ │ │ │ try: │
│ 165 │ │ │ │ │ task_point.fetch_attachment() │
│ │
│ /app/cxapi/chapters.py:161 in getitem
│ │
│ 158 │ │ self.logger.info("任务点状态已更新") │
│ 159 │ │
│ 160 │ def getitem(self, key: int) -> list[TaskPointType]: │
│ ❱ 161 │ │ return self.fetch_points_by_index(key) │
│ 162 │ │
│ 163 │ def len(self) -> int: │
│ 164 │ │ return len(self.chapters) │
│ │
│ /app/cxapi/chapters.py:186 in fetch_points_by_index │
│ │
│ 183 │ │ ) │
│ 184 │ │ resp.raise_for_status() │
│ 185 │ │ json_content = resp.json() │
│ ❱ 186 │ │ if len(json_content["data"]) == 0: │
│ 187 │ │ │ self.logger.error( │
│ 188 │ │ │ │ f"获取章节任务节点卡片失败 " │
│ 189 │ │ │ │ f"[{self.chapters[index].label}:{self.chapters[index].name}(Id.{self.cha │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'data'
程序运行出现错误, 请截图保存并附上 log 文件在 issue 提交

@SocialSisterYi SocialSisterYi added the bug Something isn't working label May 14, 2024
@SocialSisterYi SocialSisterYi changed the title 提示让我提交log 获取章节任务点有概率报错KeyError: 'data' May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants