diff --git a/rust/pact_matching/src/json.rs b/rust/pact_matching/src/json.rs index ff08bff96..a95815328 100644 --- a/rust/pact_matching/src/json.rs +++ b/rust/pact_matching/src/json.rs @@ -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(()), diff --git a/rust/pact_matching/src/matchingrules.rs b/rust/pact_matching/src/matchingrules.rs index 3eb51e3c5..93b631630 100644 --- a/rust/pact_matching/src/matchingrules.rs +++ b/rust/pact_matching/src/matchingrules.rs @@ -148,7 +148,7 @@ impl Matches<&[u8]> for Vec { } 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() {