class RSS2EmailError (Exception):
+ def __init__(self, message):
+ super(RSS2EmailError, self).__init__(message)
+
def log(self):
LOG.error(str(self))
if self.__cause__ is not None:
else:
message = '{} second timeout exceeded'.format(
time_limited_function.timeout)
- super(TimeoutError, self).__init__(message)
+ super(TimeoutError, self).__init__(message=message)
self.time_limited_function = time_limited_function
class NoValidEncodingError (ValueError, RSS2EmailError):
def __init__(self, string, encodings):
- msg = 'no valid encoding for {} in {}'.format(string, encodings)
- super(NoValidEncodingError, self).__init__(msg)
+ message = 'no valid encoding for {} in {}'.format(string, encodings)
+ super(NoValidEncodingError, self).__init__(message=message)
self.string = string
self.encodings = encodings
def __init__(self, server, message=None):
if message is None:
message = 'could not connect to mail server {}'.format(server)
- super(SMTPConnectionError, self).__init__(message)
+ super(SMTPConnectionError, self).__init__(message=message)
self.server = server
def log(self):
message = 'sendmail exited with code {}'.format(status)
else:
message = ''
- super(SendmailError, self).__init__(message)
+ super(SendmailError, self).__init__(message=message)
self.status = status
self.stdout = stdout
self.stderr = stderr
def __init__(self, feed, message=None):
if message is None:
message = 'error with feed {}'.format(feed.name)
- super(FeedError, self).__init__(message)
+ super(FeedError, self).__init__(message=message)
self.feed = feed
class FeedsError (RSS2EmailError):
- def __init__(self, feeds=None, message=None):
+ def __init__(self, feeds=None, message=None, **kwargs):
if message is None:
message = 'error with feeds'
- super(FeedsError, self).__init__(message)
+ super(FeedsError, self).__init__(message=message, **kwargs)
self.feeds = feeds