Browse Source

抛出对应的空文件异常

pull/3384/head
fanwanlong 2 years ago
parent
commit
dacbac0bf0
  1. 4
      easyexcel-core/src/main/java/com/alibaba/excel/support/ExcelTypeEnum.java

4
easyexcel-core/src/main/java/com/alibaba/excel/support/ExcelTypeEnum.java

@ -11,6 +11,8 @@ import com.alibaba.excel.read.metadata.ReadWorkbook;
import com.alibaba.excel.util.StringUtils;
import lombok.Getter;
import org.apache.poi.EmptyFileException;
import org.apache.poi.util.IOUtils;
/**
@ -87,6 +89,8 @@ public enum ExcelTypeEnum {
return recognitionExcelType(inputStream);
} catch (ExcelCommonException e) {
throw e;
} catch (EmptyFileException e) {
throw new ExcelCommonException("The supplied file was empty (zero bytes long)");
} catch (Exception e) {
throw new ExcelCommonException(
"Convert excel format exception.You can try specifying the 'excelType' yourself", e);

Loading…
Cancel
Save