Skip to content

Commit

Permalink
fix: Avoid exception on missing URL for jvndb
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Jan 10, 2025
1 parent d407534 commit cb58846
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vulnerabilitylookup/feeders/jvndb.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ def _fetch_feeds(self) -> list[Path]:
to_fetch = base_url.format(year=year)
with (self.files_storage / f'jvndb_{year}.rdf').open('w') as f:
response = requests.get(to_fetch, timeout=15)
try:
response.raise_for_status()
except requests.exceptions.HTTPError as e:
self.logger.warning(f'Failed to fetch {to_fetch} with {e}')
continue
f.write(response.text)
all_files.append(self.files_storage / f'jvndb_{year}.rdf')

Expand Down

0 comments on commit cb58846

Please sign in to comment.