Skip to content

Commit

Permalink
feat: Rephrase the content type matching error message
Browse files Browse the repository at this point in the history
  • Loading branch information
tienvx committed Feb 7, 2024
1 parent 78ab08b commit 20742d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rust/pact_matching/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl Matches<&Value> for Value {
},
MatchingRule::ContentType(ref expected_content_type) => {
match_content_type(&convert_data(actual), expected_content_type)
.map_err(|err| anyhow!("Expected data to have a content type of '{}' but was {}", expected_content_type, err))
.map_err(|err| anyhow!("Failed to match data to have a content type of '{}': {}", expected_content_type, err))
}
MatchingRule::Boolean => match actual {
Value::Bool(_) => Ok(()),
Expand Down
2 changes: 1 addition & 1 deletion rust/pact_matching/src/matchingrules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl Matches<&[u8]> for Vec<u8> {
}
MatchingRule::ContentType(ref expected_content_type) => {
match_content_type(actual, expected_content_type)
.map_err(|err| anyhow!("Expected data to have a content type of '{}' but was {}", expected_content_type, err))
.map_err(|err| anyhow!("Failed to match data to have a content type of '{}': {}", expected_content_type, err))
}
MatchingRule::NotEmpty => {
if actual.is_empty() {
Expand Down

0 comments on commit 20742d9

Please sign in to comment.