This is an automated email from the ASF dual-hosted git repository.
critas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 4350a56c237 Description add the file name when importing file
exception (#15237)
4350a56c237 is described below
commit 4350a56c237b74fca3781a3c9f80bb71c0cd4fda
Author: Summer <[email protected]>
AuthorDate: Mon Mar 31 23:29:32 2025 +0800
Description add the file name when importing file exception (#15237)
* description add the file name when importing file exception
* description add the file name when importing file exception
* description add the file name when importing file exception
---------
Co-authored-by: 2b3c511 <[email protected]>
---
.../java/org/apache/iotdb/tool/data/AbstractImportData.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git
a/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/data/AbstractImportData.java
b/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/data/AbstractImportData.java
index 7f32d8061b2..769d5fd14a0 100644
---
a/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/data/AbstractImportData.java
+++
b/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/data/AbstractImportData.java
@@ -44,18 +44,19 @@ public abstract class AbstractImportData extends
AbstractDataTool implements Run
@Override
public void run() {
- String filePath;
+ String filePath = "";
+ File file = null;
try {
if (Constants.TSFILE_SUFFIXS.equalsIgnoreCase(fileType)) {
while ((filePath = ImportTsFileScanTool.pollFromQueue()) != null) {
- File file = new File(filePath);
+ file = new File(filePath);
if (file.getName().endsWith(Constants.TSFILE_SUFFIXS)) {
importFromTsFile(file);
}
}
} else {
while ((filePath = ImportDataScanTool.pollFromQueue()) != null) {
- File file = new File(filePath);
+ file = new File(filePath);
if (file.getName().endsWith(Constants.SQL_SUFFIXS)) {
importFromSqlFile(file);
} else {
@@ -64,7 +65,8 @@ public abstract class AbstractImportData extends
AbstractDataTool implements Run
}
}
} catch (Exception e) {
- ioTPrinter.println("Unexpected error occurred: " + e.getMessage());
+ ioTPrinter.println(
+ String.format("[%s] - Unexpected error occurred: %s",
file.getName(), e.getMessage()));
}
}