diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 97e3546abb..e6ed3c62e3 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -273,7 +273,7 @@ public class TestCaseService { .map(TestCase::getName) .collect(Collectors.toSet()); List> errList = null; - if(multipartFile == null ) + if (multipartFile == null) MSException.throwException(Translator.get("upload_fail")); if (multipartFile.getOriginalFilename().endsWith(".xmind")) { @@ -286,13 +286,12 @@ public class TestCaseService { ExcelErrData excelErrData = new ExcelErrData(null, 1, Translator.get("upload_fail") + ":" + processLog); errList.add(excelErrData); excelResponse.setErrList(errList); - }else if(xmindParser.getNodePaths().isEmpty() && xmindParser.getTestCase().isEmpty() ){ + } else if (xmindParser.getNodePaths().isEmpty() && xmindParser.getTestCase().isEmpty()) { excelResponse.setSuccess(false); ExcelErrData excelErrData = new ExcelErrData(null, 1, Translator.get("upload_fail") + ":" + Translator.get("upload_content_is_null")); errList.add(excelErrData); excelResponse.setErrList(errList); - } - else { + } else { if (!xmindParser.getNodePaths().isEmpty()) { testCaseNodeService.createNodes(xmindParser.getNodePaths(), projectId); } @@ -303,7 +302,8 @@ public class TestCaseService { excelResponse.setSuccess(true); } } catch (Exception e) { - e.printStackTrace(); + LogUtil.error(e.getMessage(), e); + MSException.throwException(e.getMessage()); } } else {