Skip to content

Commit 1102d93

Browse files
committed
display replayable payload as error
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent d47075a commit 1102d93

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

vulnerabilities/fetch.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# See https://aboutcode.org for more information about AboutCode FOSS projects.
77
#
88

9+
import json
910
import logging
1011
from timeit import default_timer as timer
1112

@@ -116,11 +117,11 @@ def fetch_for_packages(
116117

117118
if vc_entries is None:
118119
failed_purls = get_plain_purls(batch)
120+
payload = json.dumps({"purls": failed_purls, "details": True}, indent=4)
119121
error_msg = (
120122
f"VulnerableCode API call failed for batch {index} "
121123
f"({len(failed_purls)} purls, "
122-
f"progress: {intcomma(progress_count)}/{intcomma(object_count)}). "
123-
f"Purls: {' '.join(failed_purls)}"
124+
f"progress: {intcomma(progress_count)}/{intcomma(object_count)}).\n{payload}"
124125
)
125126
logger.error(error_msg)
126127
if err_func:

0 commit comments

Comments
 (0)