chaokunyang commented on code in PR #2284: URL: https://github.com/apache/fury/pull/2284#discussion_r2122773852
########## java/fury-core/src/main/java/org/apache/fury/util/ExceptionUtils.java: ########## @@ -57,15 +59,36 @@ public static StackOverflowError trySetStackOverflowErrorMessage( public static RuntimeException handleReadFailed(Fury fury, Throwable t) { if (fury.getRefResolver() instanceof MapRefResolver) { - ObjectArray readObjects = ((MapRefResolver) fury.getRefResolver()).getReadObjects(); - // carry with read objects for better trouble shooting. - List<Object> objects = Arrays.asList(readObjects.objects).subList(0, readObjects.size); - throw new DeserializationException(objects, t); + List<Object> exceptionObjects = getExceptionObjects(fury); + throw new DeserializationException(exceptionObjects, t); } else { Platform.throwException(t); throw new IllegalStateException("unreachable"); } } + public static List<Object> getExceptionObjects(Fury fury) { + ObjectArray readObjects = ((MapRefResolver) fury.getRefResolver()).getReadObjects(); + // carry with read objects for better trouble shooting. + List<Object> objects = Arrays.asList(readObjects.objects).subList(0, readObjects.size); + switch (fury.getExceptionLogMode()) { + case NONE_PRINT: + return new ArrayList<>(); + case SAMPLE_PRINT: Review Comment: how about limiting max samples instead of configuring sample step? Using step will print little things for small object, and still print lots of things for big object -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@fury.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@fury.apache.org For additional commands, e-mail: commits-h...@fury.apache.org