Skip to content

Commit

Permalink
Update error descriptions from feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
  • Loading branch information
AyanSinhaMahapatra committed Nov 12, 2024
1 parent a50352c commit 364f995
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scanpipe/pipes/purldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ def get_unique_unresolved_purls(project):
vers = range_class.from_native(extracted_requirement)
except (InvalidVersionRange, InvalidVersion) as exception:
if exception is InvalidVersionRange:
description = "Invalid VersionRange"
description = "Version range is invalid or unsupported"
else:
description = "Invalid exctracted requirement"
description = "Extracted requirement is not a valid version"
details = {
"purl": purl,
"extracted_requirement": extracted_requirement,
Expand Down
4 changes: 3 additions & 1 deletion scanpipe/tests/pipes/test_purldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ def test_scanpipe_pipes_purldb_get_unique_unresolved_purls_error(self):

self.assertEqual(set(), result)
error_message = self.project1.projectmessages.all()[0]
self.assertEqual("Invalid exctracted requirement", error_message.description)
self.assertEqual(
"Extracted requirement is not a valid version", error_message.description
)

@mock.patch("scanpipe.pipes.purldb.request_post")
@mock.patch("scanpipe.pipes.purldb.is_available")
Expand Down

0 comments on commit 364f995

Please sign in to comment.