MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / on_exception

Method on_exception

cassandra/pool.py:322–337  ·  view source on GitHub ↗

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

(self, exc, next_delay)

Source from the content-addressed store, hash-verified

320 pass
321
322 def on_exception(self, exc, next_delay):
323 """
324 Called when an Exception is raised when trying to connect.
325 `exc` is the Exception that was raised and `next_delay` is the
326 number of seconds (as a float) that the handler will wait before
327 attempting to connect again.
328
329 Subclasses should return :const:`False` if no more attempts to
330 connection should be made, :const:`True` otherwise. The default
331 behavior is to always retry unless the error is an
332 :exc:`.AuthenticationFailed` instance.
333 """
334 if isinstance(exc, AuthenticationFailed):
335 return False
336 else:
337 return True
338
339
340class _HostReconnectionHandler(_ReconnectionHandler):

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected