Skip to content

Commit 5409831

Browse files
author
Andrey Ershov
committed
unwrapCause
1 parent 765f66f commit 5409831

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,11 @@ void logNow() {
198198
}
199199

200200
static Level getLogLevel(TransportException e) {
201-
if (e instanceof RemoteTransportException) {
202-
Throwable cause = e.getCause();
203-
if (cause != null &&
204-
cause instanceof CoordinationStateRejectedException ||
205-
cause instanceof FailedToCommitClusterStateException ||
206-
cause instanceof NotMasterException) {
207-
return Level.DEBUG;
208-
}
201+
Throwable cause = e.unwrapCause();
202+
if (cause instanceof CoordinationStateRejectedException ||
203+
cause instanceof FailedToCommitClusterStateException ||
204+
cause instanceof NotMasterException) {
205+
return Level.DEBUG;
209206
}
210207
return Level.INFO;
211208
}

0 commit comments

Comments
 (0)