Commit 06efad85 authored by Seungbin Yim's avatar Seungbin Yim
Browse files

Log TooManyRedirects Exception

parent d14c92b0
......@@ -12,7 +12,7 @@ from itertools import filterfalse
from datetime import datetime, timezone
from model.sshoc_tool import SshocItem, SshocPublication
from openapi_client import *
from requests.exceptions import HTTPError, ConnectionError
from requests.exceptions import HTTPError, ConnectionError, TooManyRedirects
from rest.rest_client import RestClient
from rest.sshoc_adapter import SshocAdapter, SshocVocabulary
from bs4 import BeautifulSoup
......@@ -196,6 +196,10 @@ class SshocToolCandidateExtractor(object):
with open('logs/pub_download_connectionerror.log', 'a+') as fne_log:
fne_log.write(link + '\n')
self.logger.debug('ConnectionError while downloading to publication source:' + link)
except TooManyRedirects:
with open('logs/pub_download_connectionerror.log', 'a+') as tmr_log:
tmr_log.write(link + '\n')
self.logger.debug('TooManyRedirects: ' + link)
self.logger.info("Total number of XML Links: " + str(xml_count))
self.logger.info("PDF download completed..")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment