From dc2854e90c8439cc5a54f6409859fd6810807b16 Mon Sep 17 00:00:00 2001 From: liuxudong08 Date: Fri, 13 Dec 2024 11:07:33 +0800 Subject: [PATCH] Add row and column indices to the doConvertToJavaObject method to provide detailed context when an error occurs. --- .../src/main/java/cn/idev/excel/util/ConverterUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastexcel-core/src/main/java/cn/idev/excel/util/ConverterUtils.java b/fastexcel-core/src/main/java/cn/idev/excel/util/ConverterUtils.java index 7a461af44..b0060374a 100644 --- a/fastexcel-core/src/main/java/cn/idev/excel/util/ConverterUtils.java +++ b/fastexcel-core/src/main/java/cn/idev/excel/util/ConverterUtils.java @@ -174,14 +174,14 @@ private static Object doConvertToJavaObject(ReadCellData cellData, Class c } if (converter == null) { throw new ExcelDataConvertException(rowIndex, columnIndex, cellData, contentProperty, - "Converter not found, convert " + cellData.getType() + " to " + clazz.getName()); + "Error at row " + rowIndex + ", column " + columnIndex + ": Converter not found, convert " + cellData.getType() + " to " + clazz.getName()); } try { return converter.convertToJavaData(new ReadConverterContext<>(cellData, contentProperty, context)); } catch (Exception e) { throw new ExcelDataConvertException(rowIndex, columnIndex, cellData, contentProperty, - "Convert data " + cellData + " to " + clazz + " error ", e); + "Error at row " + rowIndex + ", column " + columnIndex + ": Convert data " + cellData + " to " + clazz + " error ", e); } } }