Skip to content

Commit

Permalink
Improve error message for expected String (#1492)
Browse files Browse the repository at this point in the history
* Improve error message for expected String

* Add changelog entry
  • Loading branch information
cmichi authored Feb 5, 2024
1 parent 37f12c8 commit 744babf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- Improved error message for Strings as CLI arguments - [#1492](https://github.com/paritytech/cargo-contract/pull/1492)
- Add a user-friendly view of contract storage data in the form of a table - [#1414](https://github.com/paritytech/cargo-contract/pull/1414)
- Add `rpc` command - [#1458](https://github.com/paritytech/cargo-contract/pull/1458)

Expand Down
4 changes: 3 additions & 1 deletion crates/transcode/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ impl<'a> Encoder<'a> {
s.encode_to(output);
Ok(())
} else {
Err(anyhow::anyhow!("Expected a String value"))
Err(anyhow::anyhow!("Expected a String value\n\
On the command-line, String values need to be wrapped in escaped quotes: \
\\\"\\\"."))
}
}
TypeDefPrimitive::U8 => encode_uint::<u8, O>(value, "u8", output),
Expand Down

0 comments on commit 744babf

Please sign in to comment.