fix(aihr): hide staging write errors

This commit is contained in:
2026-07-14 08:43:34 +08:00
parent dc75b227e7
commit 7f519dd8f0
2 changed files with 3 additions and 1 deletions
@@ -103,7 +103,7 @@ public class AihrUploadQueueService {
Files.createDirectories(staged.getParent());
Files.copy(input, staged, StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
throw new ServiceException("暂存文件写入失败:" + e.getMessage());
throw new ServiceException("暂存文件写入失败,请重试或联系管理员");
}
jdbcTemplate.update("""
insert into aihr_knowledge_upload_item
@@ -27,6 +27,8 @@ class AihrUploadQueueServiceTest {
assertTrue(code.contains("new ItemRow(rs.getString(\"tenant_id\")"));
assertTrue(code.contains("where status = 1\n and ("));
assertTrue(code.contains("资料加工失败,请重试或联系管理员"));
assertTrue(code.contains("暂存文件写入失败,请重试或联系管理员"));
assertFalse(code.contains("\"暂存文件写入失败:\" + e.getMessage()"));
assertFalse(code.contains("where tenant_id = ? and status = 1\n and ("));
}
}