Skip to content

Commit

Permalink
A few minor fixes
Browse files Browse the repository at this point in the history
- Makes BugSnag optional
- Add connection timeout for sitemap ingestion
  • Loading branch information
battleoverflow committed Oct 11, 2023
1 parent 1eae088 commit 2ccc1a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion threatingestor/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def logging(self):

def error_reporting(self):
"""Returns error_reporting config dictionary."""
return self.config['error_reporting']
return self.config.get('error_reporting', {})


def credentials(self, credential_name):
Expand Down
7 changes: 5 additions & 2 deletions threatingestor/sources/sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ def run(self, saved_state):
# Extracts only the 'loc' tag from the xml
if xml.find("loc"):
loc = u.findNext("loc").text
response = requests.get(loc)
soup = BeautifulSoup(response.text, 'html.parser')
try:
response = requests.get(loc)
soup = BeautifulSoup(response.text, 'html.parser')
except requests.exceptions.ConnectTimeout:
continue
else:
continue

Expand Down

0 comments on commit 2ccc1a5

Please sign in to comment.