fix(aihr): hide staging write errors
This commit is contained in:
+1
-1
@@ -103,7 +103,7 @@ public class AihrUploadQueueService {
|
|||||||
Files.createDirectories(staged.getParent());
|
Files.createDirectories(staged.getParent());
|
||||||
Files.copy(input, staged, StandardCopyOption.REPLACE_EXISTING);
|
Files.copy(input, staged, StandardCopyOption.REPLACE_EXISTING);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ServiceException("暂存文件写入失败:" + e.getMessage());
|
throw new ServiceException("暂存文件写入失败,请重试或联系管理员");
|
||||||
}
|
}
|
||||||
jdbcTemplate.update("""
|
jdbcTemplate.update("""
|
||||||
insert into aihr_knowledge_upload_item
|
insert into aihr_knowledge_upload_item
|
||||||
|
|||||||
+2
@@ -27,6 +27,8 @@ class AihrUploadQueueServiceTest {
|
|||||||
assertTrue(code.contains("new ItemRow(rs.getString(\"tenant_id\")"));
|
assertTrue(code.contains("new ItemRow(rs.getString(\"tenant_id\")"));
|
||||||
assertTrue(code.contains("where status = 1\n and ("));
|
assertTrue(code.contains("where status = 1\n and ("));
|
||||||
assertTrue(code.contains("资料加工失败,请重试或联系管理员"));
|
assertTrue(code.contains("资料加工失败,请重试或联系管理员"));
|
||||||
|
assertTrue(code.contains("暂存文件写入失败,请重试或联系管理员"));
|
||||||
|
assertFalse(code.contains("\"暂存文件写入失败:\" + e.getMessage()"));
|
||||||
assertFalse(code.contains("where tenant_id = ? and status = 1\n and ("));
|
assertFalse(code.contains("where tenant_id = ? and status = 1\n and ("));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user