Repository navigation
fix: 修复 Excel 导入及下载校验错误返回 500 - #1420
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
术语配置、SQL 示例库及用户批量导入上传
bad.csv时,应返回 HTTP 400 和可读提示;此前返回 HTTP 500 和"(400, 'Only support .xlsx/.xls')"。在四个模块统一使用 FastAPI 异常类,让现有异常处理器保留预期状态码;同时恢复相关错误文件下载分支的 400、403、404。保留现有错误文案和文件校验规则。
Evidence
4c059d13上运行新增回归用例:16 failed、7 passed;术语配置和 SQL 示例库导入接口均复现 HTTP 500 和原始元组文本。After: 基于远端
main的368f9fd7完成修复(提交db36744e),同组用例 23 passed。backend/执行:LOG_FORMAT='%(levelname)s %(message)s' uv run --no-sync pytest -q tests/test_excel_http_errors.py --tb=short --show-capture=no --disable-warnings uv run --no-sync ruff check tests/test_excel_http_errors.py uv run --no-sync ruff format --check tests/test_excel_http_errors.pygit diff --check通过。四个既有模块的 Ruff/格式检查未全通过;已与未修改基线对照,48 条 lint 诊断未新增。Merge Danger
Door: two-way
仅修正异常导入并增加测试,无迁移或依赖升级,可直接回退。
Blast Radius: Excel
相关错误响应由 500 恢复为既定的 400/403/404;调用方应将其作为客户端错误处理。xpack 自定义提示词的同类问题留待此 PR 合并后在独立仓库处理,本 PR 不包含 xpack 变更。