Skip to content

Commit

Permalink
improve version parse error msg (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben-arts authored Jun 8, 2023
1 parent 8f0bdc6 commit b5f117b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/rattler_conda_types/src/match_spec/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ pub enum ParseMatchSpecError {
#[error("multiple bracket sections not allowed")]
MultipleBracketSectionsNotAllowed,

#[error("invalid version and build")]
InvalidVersionAndBuild,
#[error("Unable to parse version spec: {0}")]
InvalidVersionAndBuild(String),

#[error("invalid version spec: {0}")]
InvalidVersionSpec(#[from] ParseVersionSpecError),
Expand Down Expand Up @@ -252,7 +252,9 @@ fn split_version_and_build(input: &str) -> Result<(&str, Option<&str>), ParseMat
},
))
}
Err(nom::error::Error { .. }) => Err(ParseMatchSpecError::InvalidVersionAndBuild),
Err(nom::error::Error { .. }) => Err(ParseMatchSpecError::InvalidVersionAndBuild(
input.to_string(),
)),
}
}

Expand Down

0 comments on commit b5f117b

Please sign in to comment.