Bug 990484 - Error when hitting max retries

The max retry logic is flawed - if the user exits the retries it returns the
range object (0..5) instead of an error or a value object.  Change logic so
that retries can continue a certain number of times.

@liggitt review plz