Skip to content

Conversation

mdqst
Copy link
Contributor

@mdqst mdqst commented Oct 9, 2025

What is the purpose of the change

cleaned up ContractError messages by removing unnecessary :? in string fields so that error messages no longer show extra quotes, also fixed the PFMNoInitiator message by adding the missing word for for clarity.

Testing and Verifying

all existing unit tests pass. no new functionality was added, so no additional behavior tests are needed.
verified that string formatting in errors now displays cleanly.

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes?
  • Changelog entry added to Unreleased section of CHANGELOG.md?

Where is the change documented?

  • Specification (x/{module}/README.md)
  • Osmosis documentation site
  • Code comments?
  • N/A

Copy link
Contributor

coderabbitai bot commented Oct 9, 2025

Walkthrough

Error message templates in ContractError within cosmwasm/contracts/crosschain-registry/src/error.rs were updated to use non-debug format specifiers and slightly revised wording, without changing any public APIs or control flow.

Changes

Cohort / File(s) Change Summary
Error message formatting updates
cosmwasm/contracts/crosschain-registry/src/error.rs
Replaced debug format specifiers (e.g., {field:?}) with display specifiers (e.g., {field}) across multiple ContractError variants; minor wording tweaks (e.g., “No initiator found this validation.” → “No initiator found for this validation.”). No signature or logic changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title “chore: cleaned up ContractError messages” succinctly and accurately reflects the primary change of removing debug format specifiers and clarifying error messages in the ContractError definitions without mentioning irrelevant details. It clearly conveys the intent and scope of the update in a concise, single sentence.
Description Check ✅ Passed The pull request description adheres to the repository template by providing a clear purpose statement, outlining testing and verification steps, and detailing documentation considerations with the specified checkboxes, and it correctly omits a Closes line since no issue is being closed. Each required section is present and sufficiently detailed to understand the changes and their validation.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e4f9f32 and 765ad55.

📒 Files selected for processing (1)
  • cosmwasm/contracts/crosschain-registry/src/error.rs (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Test Cosmwasm Contracts (./cosmwasm/, tests/ibc-hooks/bytecode/swaprouter.wasm, artifacts/swaprou...
  • GitHub Check: Test Cosmwasm Contracts (./cosmwasm/, tests/ibc-hooks/bytecode/outpost.wasm, artifacts/outpost.wa...
  • GitHub Check: Optimize Cosmwasm Contracts (./x/ibc-rate-limit/, x/ibc-rate-limit/bytecode/rate_limiter.wasm, ar...
  • GitHub Check: Optimize Cosmwasm Contracts (./cosmwasm/, tests/ibc-hooks/bytecode/outpost.wasm, artifacts/outpos...
  • GitHub Check: Optimize Cosmwasm Contracts (./cosmwasm/, tests/ibc-hooks/bytecode/crosschain_swaps.wasm, artifac...
  • GitHub Check: Test Cosmwasm Contracts (./cosmwasm/, tests/ibc-hooks/bytecode/crosschain_swaps.wasm, artifacts/c...
  • GitHub Check: Optimize Cosmwasm Contracts (./cosmwasm/, tests/ibc-hooks/bytecode/swaprouter.wasm, artifacts/swa...
  • GitHub Check: Summary
🔇 Additional comments (4)
cosmwasm/contracts/crosschain-registry/src/error.rs (4)

38-48: LGTM! Improved alias error message formatting.

Removing the debug formatter (:?) from string fields eliminates unnecessary quotes in error messages, making them cleaner and more user-friendly. This also brings consistency with the InvalidAlias error on line 53.


57-62: LGTM! Formatting and grammar improvements.

The removal of :? improves message display consistency, and the grammar fix on line 61 ("for this validation" instead of "this validation") significantly improves message clarity.


64-80: LGTM! Consistent formatting across link errors.

The debug formatter removal is consistently applied across all link-related errors, improving the display of chain identifiers, channel IDs, and denominations in error messages.


82-89: LGTM! Cleaner generic error messages.

Removing the debug formatter from these generic error variants ensures that custom messages, field names, and validation messages display cleanly without extra quotes. This is especially valuable for the CustomError variant which may contain arbitrary user-facing text.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you!

@github-actions github-actions bot added the Stale label Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant