File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
fluss-client/src/main/java/com/alibaba/fluss/client/utils Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -490,10 +490,10 @@ public GenericRow toRow(T pojo) {
490490 try {
491491 value = fieldToRowConverters [i ].convert (pojo );
492492 } catch (IllegalAccessException e ) {
493- LOG . warn (
494- "Failed to access field {} in POJO class {}." ,
495- rowType . getFieldNames (). get ( i ) ,
496- pojoClass .getName (),
493+ throw new IllegalStateException (
494+ String . format (
495+ "Failed to access field '%s' in POJO class %s while converting to row. Ensure the field is accessible." ,
496+ rowType . getFieldNames (). get ( i ), pojoClass .getName () ),
497497 e );
498498 }
499499 row .setField (i , value );
@@ -524,10 +524,10 @@ public T fromRow(InternalRow row) {
524524 pojoFields [i ].set (pojo , value );
525525 }
526526 } catch (IllegalAccessException e ) {
527- LOG . warn (
528- "Failed to set field {} in POJO class {}." ,
529- rowType . getFieldNames (). get ( i ) ,
530- pojoClass .getName (),
527+ throw new IllegalStateException (
528+ String . format (
529+ "Failed to set field '%s' in POJO class %s while converting from row. Ensure the field is accessible and not final." ,
530+ rowType . getFieldNames (). get ( i ), pojoClass .getName () ),
531531 e );
532532 }
533533 }
You can’t perform that action at this time.
0 commit comments