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)
| 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 | |
| 340 | class _HostReconnectionHandler(_ReconnectionHandler): |