'Called when an Exception is raised when trying to connect.
`exc` is the Exception that was raised and `next_delay` is the
number of seconds (as a float) that the handler will wait before
attempting to connect again.
Subclasses should return :const:`False` if no more attempts to
connection should be made, :const:`True` otherwise.  The default
behavior is to always retry unless the error is an
:exc:`.AuthenticationFailed` instance.'

def on_exception(self, exc, next_delay):

    if isinstance(exc, AuthenticationFailed):
        return False
    else:
        return True
