mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Handling PyAsn1Error
This commit is contained in:
parent
a73e8830ca
commit
5e064fcc2e
2 changed files with 4 additions and 2 deletions
|
@ -14,6 +14,7 @@ from utils import log as logging
|
||||||
from apps.rss_feeds.models import MFeedPage
|
from apps.rss_feeds.models import MFeedPage
|
||||||
from utils.feed_functions import timelimit
|
from utils.feed_functions import timelimit
|
||||||
from OpenSSL.SSL import Error as OpenSSLError
|
from OpenSSL.SSL import Error as OpenSSLError
|
||||||
|
from pyasn1.error import PyAsn1Error
|
||||||
# from utils.feed_functions import mail_feed_error_to_admin
|
# from utils.feed_functions import mail_feed_error_to_admin
|
||||||
|
|
||||||
BROKEN_PAGES = [
|
BROKEN_PAGES = [
|
||||||
|
@ -82,7 +83,7 @@ class PageImporter(object):
|
||||||
response.connection.close()
|
response.connection.close()
|
||||||
except requests.exceptions.TooManyRedirects:
|
except requests.exceptions.TooManyRedirects:
|
||||||
response = requests.get(feed_link)
|
response = requests.get(feed_link)
|
||||||
except (AttributeError, SocketError, OpenSSLError), e:
|
except (AttributeError, SocketError, OpenSSLError, PyAsn1Error), e:
|
||||||
logging.debug(' ***> [%-30s] Page fetch failed using requests: %s' % (self.feed, e))
|
logging.debug(' ***> [%-30s] Page fetch failed using requests: %s' % (self.feed, e))
|
||||||
self.save_no_page()
|
self.save_no_page()
|
||||||
return
|
return
|
||||||
|
|
|
@ -8,6 +8,7 @@ from vendor.readability import readability
|
||||||
from utils import log as logging
|
from utils import log as logging
|
||||||
from utils.feed_functions import timelimit, TimeoutError
|
from utils.feed_functions import timelimit, TimeoutError
|
||||||
from OpenSSL.SSL import Error as OpenSSLError
|
from OpenSSL.SSL import Error as OpenSSLError
|
||||||
|
from pyasn1.error import PyAsn1Error
|
||||||
|
|
||||||
class TextImporter:
|
class TextImporter:
|
||||||
|
|
||||||
|
@ -97,7 +98,7 @@ class TextImporter:
|
||||||
r.connection.close()
|
r.connection.close()
|
||||||
except (AttributeError, SocketError, requests.ConnectionError,
|
except (AttributeError, SocketError, requests.ConnectionError,
|
||||||
requests.models.MissingSchema, requests.sessions.InvalidSchema,
|
requests.models.MissingSchema, requests.sessions.InvalidSchema,
|
||||||
LocationParseError, OpenSSLError), e:
|
LocationParseError, OpenSSLError, PyAsn1Error), e:
|
||||||
logging.user(self.request, "~SN~FRFailed~FY to fetch ~FGoriginal text~FY: %s" % e)
|
logging.user(self.request, "~SN~FRFailed~FY to fetch ~FGoriginal text~FY: %s" % e)
|
||||||
return
|
return
|
||||||
return r
|
return r
|
||||||
|
|
Loading…
Add table
Reference in a new issue