Skip to content

fix properly interpolate variables in generate.rs error messages#862

Merged
benbrandt merged 1 commit intoagentclientprotocol:mainfrom
anaslimem:fix-error-message-format
Mar 27, 2026
Merged

fix properly interpolate variables in generate.rs error messages#862
benbrandt merged 1 commit intoagentclientprotocol:mainfrom
anaslimem:fix-error-message-format

Conversation

@anaslimem
Copy link
Copy Markdown
Contributor

Summary

Fixes incorrect error message formatting in src/bin/generate.rs where file write failures would display literal placeholder text instead of actual values.

Changes

Fixed three locations where .expect() was used with format string placeholders that were never interpolated:

  • Line 69: schema_file - Fixed error when writing schema JSON
  • Line 95: meta_file - Fixed error when writing metadata JSON
  • Line 107: doc_file - Fixed error when writing markdown documentation

Before vs After

Scenario Before (broken) After (fixed)
Write fails Failed to write {schema_file} Failed to write schema.json: Permission denied

Testing

  • Verified the fix compiles without clippy warnings
  • Created a temporary test that triggered the error path to confirm proper variable interpolation

@anaslimem anaslimem requested a review from a team as a code owner March 27, 2026 13:45
@benbrandt benbrandt enabled auto-merge (squash) March 27, 2026 15:37
@benbrandt benbrandt merged commit f3c2a86 into agentclientprotocol:main Mar 27, 2026
1 check passed
@acp-release-bot acp-release-bot bot mentioned this pull request Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants