Skip to content

Commit 06affd8

Browse files
joshbruninglukeis
authored andcommitted
Clear lastException if it is not the cause. (#2768)
Clear lastException if it is not the cause. If another retry or timeout exception would be caused by a false or null value, the last exception is not the cause of the timeout.
1 parent b96b13f commit 06affd8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

java/client/src/org/openqa/selenium/support/ui/FluentWait.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,11 @@ public <V> V until(Function<? super T, V> isTrue) {
243243
} else if (value != null) {
244244
return value;
245245
}
246+
247+
// Clear the last exception; if another retry or timeout exception would
248+
// be caused by a false or null value, the last exception is not the
249+
// cause of the timeout.
250+
lastException = null;
246251
} catch (Throwable e) {
247252
lastException = propagateIfNotIgnored(e);
248253
}

0 commit comments

Comments
 (0)