Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def log(self):
super(SMTPConnectionError, self).log()
_LOG.warning(
'check your config file to confirm that smtp-server and other '
'mail server settings are configured properly')
if hasattr(self.__cause__, 'reason'):
_LOG.error('reason: {}'.format(self.__cause__.reason))
else:
_LOG.debug('unrecognized version: {}'.format(self))
warned = True
exc = parsed.get('bozo_exception', None)
if isinstance(exc, _socket.timeout):
_LOG.error('timed out: {}'.format(self))
warned = True
elif isinstance(exc, OSError):
_LOG.error('{}: {}'.format(exc, self))
warned = True
elif isinstance(exc, _SOCKET_ERRORS):
_LOG.error('{}: {}'.format(exc, self))
warned = True
elif isinstance(exc, _feedparser.zlib.error):
_LOG.error('broken compression: {}'.format(self))
warned = True
elif isinstance(exc, (IOError, AttributeError)):
_LOG.error('{}: {}'.format(exc, self))
warned = True
elif isinstance(exc, KeyboardInterrupt):
raise exc
elif isinstance(exc, _sax.SAXParseException):
_LOG.error('sax parsing error: {}: {}'.format(exc, self))
warned = True
elif (parsed.bozo and
isinstance(exc, _feedparser.CharacterEncodingOverride)):
_LOG.warning(
'incorrectly declared encoding: {}: {}'.format(exc, self))
warned = True
elif (parsed.bozo and isinstance(exc, _feedparser.NonXMLContentType)):
_LOG.warning('non XML Content-Type: {}: {}'.format(exc, self))
version = parsed.get('version', None)
if version:
_LOG.debug('feed version {}'.format(version))
else:
_LOG.debug('unrecognized version: {}'.format(self))
warned = True
exc = parsed.get('bozo_exception', None)
if isinstance(exc, _socket.timeout):
_LOG.error('timed out: {}'.format(self))
warned = True
elif isinstance(exc, OSError):
_LOG.error('{}: {}'.format(exc, self))
warned = True
elif isinstance(exc, _SOCKET_ERRORS):
_LOG.error('{}: {}'.format(exc, self))
warned = True
elif isinstance(exc, _feedparser.zlib.error):
_LOG.error('broken compression: {}'.format(self))
warned = True
elif isinstance(exc, (IOError, AttributeError)):
_LOG.error('{}: {}'.format(exc, self))
warned = True
elif isinstance(exc, KeyboardInterrupt):
raise exc
elif isinstance(exc, _sax.SAXParseException):
_LOG.error('sax parsing error: {}: {}'.format(exc, self))
warned = True
elif (parsed.bozo and
isinstance(exc, _feedparser.CharacterEncodingOverride)):
_LOG.warning(
'incorrectly declared encoding: {}: {}'.format(exc, self))
def log(self):
super(IMAPConnectionError, self).log()
_LOG.warning(
'check your config file to confirm that imap-server and other '
'mail server settings are configured properly')
if hasattr(self.__cause__, 'reason'):
_LOG.error('reason: {}'.format(self.__cause__.reason))
def log(self):
_LOG.error(str(self))
if self.__cause__ is not None:
_LOG.error('cause: {}'.format(self.__cause__))