Skip to content

Commit

Permalink
fix(importer): update log message with error details (#2574)
Browse files Browse the repository at this point in the history
Add error message into the log for better debugging

---------

Co-authored-by: Andrew Pollock <andrewpollock@users.noreply.github.com>
  • Loading branch information
hogo6002 and andrewpollock authored Sep 9, 2024
1 parent 7d10114 commit 1f8def9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docker/importer/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,9 @@ def _process_updates_rest(self, source_repo: osv.SourceRepository):
# No need to log a full error, as this is expected result.
logging.info('Entry does not have an OSV entry: %s', vuln.id)
continue
except Exception:
logging.error('Failed to parse %s', vuln.id)
except Exception as e:
logging.excecption('Failed to parse %s: error type: %s, details: %s',
vuln.id, e.__class__.__name__, e)
import_failure_logs.append('Failed to parse vulnerability "' + vuln.id +
'"')
continue
Expand Down

0 comments on commit 1f8def9

Please sign in to comment.