Skip to content

Commit

Permalink
improved error message
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby authored and radoering committed Apr 1, 2023
1 parent 85dcf07 commit 964791e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/poetry/core/version/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def __init__(
# Extract operator and value
m = self._CONSTRAINT_RE.match(constraint_string)
if m is None:
raise InvalidMarker(f"Invalid marker '{constraint_string}'")
raise InvalidMarker(f"Invalid marker for '{name}': {constraint_string}")

self._operator = m.group(1)
if self._operator is None:
Expand Down Expand Up @@ -359,7 +359,9 @@ def __init__(
try:
parsed_constraint = parser(constraint_string)
except ParseConstraintError as e:
raise InvalidMarker(f"Invalid marker: {original_constraint_string}") from e
raise InvalidMarker(
f"Invalid marker for '{name}': {original_constraint_string}"
) from e

super().__init__(name, parsed_constraint)

Expand Down

0 comments on commit 964791e

Please sign in to comment.