Copilot commented on code in PR #753:
URL: 
https://github.com/apache/hugegraph-toolchain/pull/753#discussion_r3734355863


##########
hugegraph-loader/src/main/java/org/apache/hugegraph/loader/executor/LoadOptions.java:
##########
@@ -359,7 +361,10 @@ public void dumpParams() {
         for (Field field : fields) {
             if (field.isAnnotationPresent(Parameter.class)) {
                 try {
-                    LOG.info("    {}={}", field.getName(), field.get(this));
+                    Object value = SENSITIVE_PARAMETER_FIELDS.contains(
+                                   field.getName()) ? "[REDACTED]" :
+                                   field.get(this);
+                    LOG.info("    {}={}", field.getName(), value);
                 } catch (IllegalAccessException e) {
                     e.printStackTrace();
                 }

Review Comment:
   `dumpParams()` currently prints stack traces directly via 
`e.printStackTrace()`, which bypasses the project logger and can pollute 
output. Prefer logging the exception through `LOG` so it respects configured 
log sinks/levels and stays consistent with the rest of the loader.



##########
hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/ingest/IngestController.java:
##########
@@ -579,6 +599,23 @@ private ColumnInfo readColumns(File file, FileSetting 
setting,
         }
     }
 
+    private ColumnInfo readJsonColumns(String line, File file) {
+        try {
+            Map<String, Object> fields = JSON_MAPPER.readValue(
+                    line, new TypeReference<LinkedHashMap<String, Object>>() {
+                    });
+            List<String> names = new ArrayList<>(fields.keySet());
+            List<String> values = names.stream()
+                                       .map(fields::get)
+                                       .map(String::valueOf)
+                                       .collect(Collectors.toList());
+            return new ColumnInfo(names, values);
+        } catch (IOException ignored) {
+            throw new InternalException(
+                    "Failed to read JSON fields from file %s", file);
+        }

Review Comment:
   `readJsonColumns()` swallows the JSON parsing IOException and rethrows an 
InternalException without preserving the original cause. This makes diagnosing 
malformed JSON (or encoding issues) much harder. Please keep the caught 
exception as the cause, consistent with the `readColumns()` error path above.



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