feat: 增加异常提示

This commit is contained in:
lilong 2024-03-25 20:31:37 +08:00
parent 7edef26ec9
commit e719fef563

View File

@ -428,7 +428,7 @@ public class DataSheetImporter extends DataSheetClient.ImporterBuilder {
} catch (Exception e) { } catch (Exception e) {
log.error("failed to convert type, cellMeta={}, rawValue={}, rowIndex={}, columnIndex={}", log.error("failed to convert type, cellMeta={}, rawValue={}, rowIndex={}, columnIndex={}",
cellMeta, rawValue, rowIndex, columnIndex, e); cellMeta, rawValue, rowIndex, columnIndex, e);
String errMsg = String.format("第%d行, 第%d列字段[%s]%s", rowIndex + 1, columnIndex + 1, String errMsg = String.format("第%d行, 第%d列字段, %s", rowIndex + 1, columnIndex + 1,
cellMeta.getName(), Optional.ofNullable(e.getMessage()) cellMeta.getName(), Optional.ofNullable(e.getMessage())
.orElse(IMPORT_CELL_CONVERT_FAILED.getMessage())); .orElse(IMPORT_CELL_CONVERT_FAILED.getMessage()));
throw new DataSheetClient.DataSheetException(IMPORT_CELL_CONVERT_FAILED.getSubBizCode(), errMsg, rowIndex, columnIndex); throw new DataSheetClient.DataSheetException(IMPORT_CELL_CONVERT_FAILED.getSubBizCode(), errMsg, rowIndex, columnIndex);