chaokunyang commented on code in PR #2284:
URL: https://github.com/apache/fury/pull/2284#discussion_r2122850500


##########
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:
   Users can know how big of theri object graph. Iif we use step, the issue 
won't be resolved in some cases. Or we could increase a new strategy which 
limit max samples, and let that mode as the default mode



-- 
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

Reply via email to