Logging just the exception object gave a sometimes-enigmatic
single line. Let's use the logger exception method so that
we get a backtrace.
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit
316dcc8f0b42b85503632d5472c45c9828882f2c)
while self.run:
self.log.debug('Waking up for new iteration')
- # Sometimes fetching data fails, should be fixed by PR #16020
try:
self.send()
except Exception as exc:
- self.log.error(exc)
+ # Shouldn't happen, but let's log it and retry next interval,
+ # rather than dying completely.
+ self.log.exception("Unexpected error during send():")
interval = self.config['interval']
self.log.debug('Sleeping for %d seconds', interval)