Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -889,21 +889,24 @@ public void insert(InsertRowPlan insertRowPlan) throws QueryProcessException {
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) {
curException = curException.getCause();
}
if (!(curException instanceof PathNotExistException)) {
isPathNotExistException = false;
exception = e;
break;
}
}
if (isPathNotExistException) {
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) {
Expand All @@ -926,6 +929,7 @@ public void insert(InsertRowsOfOneDevicePlan insertRowsOfOneDevicePlan)

List<String> notExistedPaths = null;
List<String> failedMeasurements = null;
Exception exception = null;
for (InsertRowPlan plan : insertRowsOfOneDevicePlan.getRowPlans()) {
if (plan.getFailedMeasurements() != null) {
if (notExistedPaths == null) {
Expand All @@ -943,6 +947,7 @@ public void insert(InsertRowsOfOneDevicePlan insertRowsOfOneDevicePlan)
}
if (!(curException instanceof PathNotExistException)) {
isPathNotExistException = false;
exception = e;
break;
}
}
Expand All @@ -955,9 +960,10 @@ public void insert(InsertRowsOfOneDevicePlan insertRowsOfOneDevicePlan)
}
if (notExistedPaths != null && !notExistedPaths.isEmpty()) {
throw new PathNotExistException(notExistedPaths);
} else if (notExistedPaths != null && !failedMeasurements.isEmpty()) {
} else if (notExistedPaths != null && !failedMeasurements.isEmpty() && exception != null) {
throw new StorageEngineException(
"failed to insert points " + failedMeasurements);
"failed to insert points " + failedMeasurements +
": " + exception.getMessage());
}

} catch (StorageEngineException | MetadataException e) {
Expand Down