DESCRIPTION

JCBC-1144: RetryBuilder - last error should not be caught.

Motivation
----------
The RetryBuilder (and subsequently the RetryWhenFunction)
fails to propagate the source exception when its exactly
the last retry attempt.

Modifications
-------------
This changeset fixes this edge case by first checking if
the given exception is part of the list to accept and if
not it propagates it right away before first checking
if the number of attempts is over.

Result
------
If a different exception is raised at the last retry
attempt, it is now propagated directly and not turned
into a composite CannotRetryException.

Change-Id: I4956c6a5fa59e5a8f06088379656d54d3bdf26ab
Reviewed-on: http://review.couchbase.org/84870
Tested-by: Hugo Blankenship xxx@xxx.xxx
Reviewed-by: Cory Peck xxx@xxx.xxx


COMMENTS

author: Natasha Sullivan
date: 2017-10-30 15:06:13.334000000

Change has been successfully cherry-picked as 3a2c881ff66793070782f8450f0088618064ab9f by Natasha Sullivan

-------------------------------------
