Stop logging tracebacks when we're about to reraise

At that point, it's up to the caller to decide whether a stack trace is
appropriate; if the caller decides the connection error is recoverable,
us logging a traceback will only confuse things.

Also, prevent a TypeError during log interpolation by actually using the
argument we were providing.
This commit is contained in:
Tim Burke 2018-06-22 11:53:25 -07:00
parent 3d2a7edc94
commit eb2fee80e8
1 changed files with 2 additions and 2 deletions

View File

@ -131,7 +131,7 @@ class ProxyKmipClient(object):
self.proxy.open()
self._is_open = True
except Exception as e:
self.logger.exception("could not open client connection", e)
self.logger.error("could not open client connection: %s", e)
raise
def close(self):
@ -148,7 +148,7 @@ class ProxyKmipClient(object):
self.proxy.close()
self._is_open = False
except Exception as e:
self.logger.exception("could not close client connection", e)
self.logger.error("could not close client connection: %s", e)
raise
@is_connected