Skip to content

Commit e12ca62

Browse files
committed
Use inner exceptions instead of strings
1 parent 9cb083f commit e12ca62

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

server/src/main/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommand.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ protected void processNodePathsWithLock(Terminal terminal, OptionSet options, En
8181
throw new ElasticsearchException(NO_NODE_FOLDER_FOUND_MSG);
8282
}
8383
processNodePaths(terminal, dataPaths, env);
84-
} catch (LockObtainFailedException ex) {
85-
throw new ElasticsearchException(
86-
FAILED_TO_OBTAIN_NODE_LOCK_MSG + " [" + ex.getMessage() + "]");
84+
} catch (LockObtainFailedException e) {
85+
throw new ElasticsearchException(FAILED_TO_OBTAIN_NODE_LOCK_MSG, e);
8786
}
8887
}
8988

@@ -185,7 +184,7 @@ private static NodeEnvironment.NodePath createNodePath(Path path) {
185184
try {
186185
return new NodeEnvironment.NodePath(path);
187186
} catch (IOException e) {
188-
throw new ElasticsearchException("Unable to investigate path: " + path + ": " + e.getMessage());
187+
throw new ElasticsearchException("Unable to investigate path [" + path + "]", e);
189188
}
190189
}
191190

0 commit comments

Comments
 (0)