添加数据验证逻辑,抛出自定义异常以处理验证失败情况;更新错误处理逻辑以显示详细错误信息

This commit is contained in:
2026-01-20 23:19:10 +08:00
parent 28e35ea429
commit 96350bb8e2
3 changed files with 41 additions and 8 deletions

View File

@@ -160,8 +160,9 @@ class DocxWriter:
cell_end = table.cell(row, col_span + non_none_count - 1)
cell_start.merge(cell_end)
except IndexError:
self.signal(f"单元格合并失败:({row}, {col_span}),需要自行检查表格准确性",
LOGLEVEL.WARNING)
pass
# self.signal(f"单元格合并失败:({row}, {col_span}),需要自行检查表格准确性",
# LOGLEVEL.WARNING)
col_span += non_none_count
start = rows - X + 3 + self.excel_reader.kpi_number