How to use the rss2email.ProcessingError function in rss2email

To help you get started, we’ve selected a few rss2email examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rss2email / rss2email / rss2email.py View on Github external
def log(self):
        super(ProcessingError, self).log()
        if type(self) == ProcessingError:  # not a more specific subclass
            LOG.warning(
                '=== rss2email encountered a problem with this feed ===')
            LOG.warning(
                '=== See the rss2email FAQ at {} for assistance ==='.format(
                    __url__))
            LOG.warning(
                '=== If this occurs repeatedly, send this to {} ==='.format(
                    __email__))
            LOG.warning(
                'error: {} {}'.format(
                    self.parsed.get('bozo_exception', "can't process"),
                    self.feed.url))
            LOG.warning(_pprint.pformat(self.parsed))
            LOG.warning('rss2email', __version__)
            LOG.warning('feedparser', _feedparser.__version__)
github rss2email / rss2email / rss2email.py View on Github external
LOG.warning(
                '=== If this occurs repeatedly, send this to {} ==='.format(
                    __email__))
            LOG.warning(
                'error: {} {}'.format(
                    self.parsed.get('bozo_exception', "can't process"),
                    self.feed.url))
            LOG.warning(_pprint.pformat(self.parsed))
            LOG.warning('rss2email', __version__)
            LOG.warning('feedparser', _feedparser.__version__)
            LOG.warning('html2text', _html2text.__version__)
            LOG.warning('Python', _sys.version)
            LOG.warning('=== END HERE ===')


class HTTPError (ProcessingError):
    def __init__(self, status, feed, **kwargs):
        message = 'HTTP status {} fetching feed {}'.format(status, feed)
        super(FeedError, self).__init__(feed=feed, message=message)
        self.status = status


class FeedsError (RSS2EmailError):
    def __init__(self, feeds=None, message=None, **kwargs):
        if message is None:
            message = 'error with feeds'
        super(FeedsError, self).__init__(message=message, **kwargs)
        self.feeds = feeds


class DataFileError (FeedsError):
    def __init__(self, feeds, message=None):
github rss2email / rss2email / rss2email.py View on Github external
elif isinstance(exc, KeyboardInterrupt):
            raise exc
        elif isinstance(exc, _sax.SAXParseException):
            LOG.error('sax parsing error: {}: {}'.format(exc, self))
            warned = True
        elif parsed.bozo or exc:
            if exc is None:
                exc = "can't process"
            LOG.error('processing error: {}: {}'.format(exc, self))
            warned = True

        if (not warned and
            status in [200, 302] and
            not parsed.entries and
            not version):
            raise ProcessingError(parsed=parsed, feed=feed)
github rss2email / rss2email / rss2email.py View on Github external
def log(self):
        super(ProcessingError, self).log()
        if type(self) == ProcessingError:  # not a more specific subclass
            LOG.warning(
                '=== rss2email encountered a problem with this feed ===')
            LOG.warning(
                '=== See the rss2email FAQ at {} for assistance ==='.format(
                    __url__))
            LOG.warning(
                '=== If this occurs repeatedly, send this to {} ==='.format(
                    __email__))
            LOG.warning(
                'error: {} {}'.format(
                    self.parsed.get('bozo_exception', "can't process"),
                    self.feed.url))
            LOG.warning(_pprint.pformat(self.parsed))
            LOG.warning('rss2email', __version__)
            LOG.warning('feedparser', _feedparser.__version__)
            LOG.warning('html2text', _html2text.__version__)