withTransientExceptions method
Adds exceptions to the set of exception types that are treated as
transient failures during polling.
A transient exception causes the current poll attempt to be silently retried. Any exception type not in the transient set will be re-thrown immediately, halting the wait.
TimeoutException and SocketException are always transient regardless of what is passed here. Duplicate types are silently ignored.
Returns this to allow fluent chaining.
Implementation
WaitStrategy withTransientExceptions(List<Type> exceptions) {
_transientExceptions = {..._transientExceptions, ...exceptions};
return this;
}