You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2020/12/30 06:57:21 UTC
[iotdb] 01/01: print more insert error in client
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch print_more_error
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit b07ac0c63bbacd02f76d027239ceccbd79951105
Author: HTHou <hh...@outlook.com>
AuthorDate: Wed Dec 30 14:56:30 2020 +0800
print more insert error in client
---
.../java/org/apache/iotdb/db/qp/executor/PlanExecutor.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
index cfc251c..e8634fd 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
@@ -889,6 +889,7 @@ public class PlanExecutor implements IPlanExecutor {
List<String> failedPaths = insertRowPlan.getFailedMeasurements();
List<Exception> exceptions = insertRowPlan.getFailedExceptions();
boolean isPathNotExistException = true;
+ Exception exception = null;
for (Exception e : exceptions) {
Throwable curException = e;
while (curException.getCause() != null) {
@@ -896,6 +897,7 @@ public class PlanExecutor implements IPlanExecutor {
}
if (!(curException instanceof PathNotExistException)) {
isPathNotExistException = false;
+ exception = e;
break;
}
}
@@ -903,7 +905,8 @@ public class PlanExecutor implements IPlanExecutor {
throw new PathNotExistException(failedPaths);
} else {
throw new StorageEngineException(
- "failed to insert points " + insertRowPlan.getFailedMeasurements());
+ "failed to insert points " + insertRowPlan.getFailedMeasurements() +
+ ": " + exception.getMessage());
}
}
} catch (StorageEngineException | MetadataException e) {
@@ -926,6 +929,7 @@ public class PlanExecutor implements IPlanExecutor {
List<String> notExistedPaths = null;
List<String> failedMeasurements = null;
+ Exception exception = null;
for (InsertRowPlan plan : insertRowsOfOneDevicePlan.getRowPlans()) {
if (plan.getFailedMeasurements() != null) {
if (notExistedPaths == null) {
@@ -943,6 +947,7 @@ public class PlanExecutor implements IPlanExecutor {
}
if (!(curException instanceof PathNotExistException)) {
isPathNotExistException = false;
+ exception = e;
break;
}
}
@@ -957,7 +962,8 @@ public class PlanExecutor implements IPlanExecutor {
throw new PathNotExistException(notExistedPaths);
} else if (notExistedPaths != null && !failedMeasurements.isEmpty()) {
throw new StorageEngineException(
- "failed to insert points " + failedMeasurements);
+ "failed to insert points " + failedMeasurements +
+ ": " + exception.getMessage());
}
} catch (StorageEngineException | MetadataException e) {