Commit 666c24cd authored by Vincent Pelletier's avatar Vincent Pelletier

cli.updater: Reduce verbosity when getting network errors.

Show the error message without a traceback.
parent c91a8bb4
...@@ -28,7 +28,6 @@ import os ...@@ -28,7 +28,6 @@ import os
import socket import socket
import struct import struct
import sys import sys
import traceback
from cryptography import x509 from cryptography import x509
from cryptography.hazmat.backends import default_backend from cryptography.hazmat.backends import default_backend
from . import exceptions from . import exceptions
...@@ -70,10 +69,14 @@ class RetryingCaucaseClient(CaucaseClient): ...@@ -70,10 +69,14 @@ class RetryingCaucaseClient(CaucaseClient):
httplib.LineTooLong, httplib.LineTooLong,
httplib.UnknownProtocol, httplib.UnknownProtocol,
httplib.IncompleteRead, httplib.IncompleteRead,
): ) as exception:
connection.close() # Resets HTTPConnection state machine. connection.close() # Resets HTTPConnection state machine.
print('Got a network error, retrying in a bit...') # Note: repr(str(exception)) is nicer than repr(exception), without
traceback.print_exc() # letting non-printable characters through.
print('Got a network error, retrying in a bit: %s: %r' % (
exception.__class__.__name__,
str(exception),
))
self._until(datetime.datetime.now() + datetime.timedelta(0, 10)) self._until(datetime.datetime.now() + datetime.timedelta(0, 10))
_cryptography_backend = default_backend() _cryptography_backend = default_backend()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment