Browse Source

Merge pull request #1995 from seven4x/bugfix

initSheet catch exception避免哑处理异常输出错误日志便于异常排错
pull/2077/head
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. 7
      src/main/java/com/alibaba/excel/context/WriteContextImpl.java

7
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)) {
} catch (Exception e) {
LOGGER.error("initSheet exception ",e);
currentSheet = createSheet();
} else {
throw e;
}
}
if (currentSheet == null) {
currentSheet = createSheet();

Loading…
Cancel
Save