imbajin commented on code in PR #683:
URL: 
https://github.com/apache/incubator-hugegraph-toolchain/pull/683#discussion_r2422431806


##########
hugegraph-loader/src/main/java/org/apache/hugegraph/loader/HugeGraphLoader.java:
##########
@@ -109,42 +203,62 @@ public boolean load() {
             // Print load summary
             Printer.printSummary(this.context);
         } catch (Throwable t) {
+            this.context.occurredError();
+
+            if (t instanceof ServerException) {
+                ServerException e = (ServerException) t;
+                String logMessage =
+                        "Log ServerException: \n" + e.exception() + "\n";
+                if (e.trace() != null) {
+                    logMessage += StringUtils.join((List<String>) e.trace(),
+                                                   "\n");

Review Comment:
   **Unsafe Type Cast**: Unchecked cast `(List<String>) e.trace()` could cause 
ClassCastException at runtime.
   
   **Recommendation**: Use proper type checking or safe casting:
   ```java
   Object trace = e.trace();
   if (trace instanceof List) {
       List<?> traceList = (List<?>) trace;
       logMessage += traceList.stream()
                             .map(Object::toString)
                             .collect(Collectors.joining("\n"));
   }
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to