Browse Source

Merge pull request #1995 from seven4x/bugfix

initSheet catch exception避免哑处理异常输出错误日志便于异常排错
developing
Jiaju Zhuang 3 years ago committed by GitHub
parent
commit
d3cf3e5033
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/main/java/com/alibaba/excel/context/WriteContextImpl.java

9
src/main/java/com/alibaba/excel/context/WriteContextImpl.java

@ -179,12 +179,9 @@ public class WriteContextImpl implements WriteContext {
writeSheetHolder
.setCachedSheet(writeWorkbookHolder.getCachedWorkbook().getSheet(writeSheetHolder.getSheetName()));
}
} catch (IllegalArgumentException e) {
if (e.getMessage() != null && e.getMessage().contains(NO_SHEETS)) {
currentSheet = createSheet();
} else {
throw e;
}
} catch (Exception e) {
LOGGER.error("initSheet exception ",e);
currentSheet = createSheet();
}
if (currentSheet == null) {
currentSheet = createSheet();

Loading…
Cancel
Save