Skip to content

Commit

Permalink
Improve bootstrap checks error messages
Browse files Browse the repository at this point in the history
When multiple bootstrap checks fail, it's not clear where one error
message begins and the next error message ends. This commit numbers the
bootstrap check error messages so they are easier to read.

Relates #24548
  • Loading branch information
jasontedor committed May 8, 2017
1 parent 025e433 commit 35e25df
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -149,8 +149,10 @@ static void check(

if (!errors.isEmpty()) {
final List<String> messages = new ArrayList<>(1 + errors.size());
messages.add("bootstrap checks failed");
messages.addAll(errors);
messages.add("[" + errors.size() + "] bootstrap checks failed");
for (int i = 0; i < errors.size(); i++) {
messages.add("[" + (i + 1) + "]: " + errors.get(i));
}
final NodeValidationException ne = new NodeValidationException(String.join("\n", messages));
errors.stream().map(IllegalStateException::new).forEach(ne::addSuppressed);
throw ne;
Expand Down

0 comments on commit 35e25df

Please sign in to comment.