mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 19:47:59 +00:00
improve error handling in cli (#7436)
* other error variant should carry a dyn Error * introduce thiserror for error derive, add explicit error variants, cleanup dependencies * cleanup handle dev-deps of sc-cli too * Update client/cli/src/error.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bernhard Schuster <bernhard@parity.io> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
3ac070b61e
commit
f373ecbcf0
@@ -246,8 +246,7 @@ pub fn decode_hex<T: AsRef<[u8]>>(message: T) -> Result<Vec<u8>, Error> {
|
||||
if message[..2] == [b'0', b'x'] {
|
||||
message = &message[2..]
|
||||
}
|
||||
hex::decode(message)
|
||||
.map_err(|e| Error::Other(format!("Invalid hex ({})", e)))
|
||||
Ok(hex::decode(message)?)
|
||||
}
|
||||
|
||||
/// checks if message is Some, otherwise reads message from stdin and optionally decodes hex
|
||||
|
||||
Reference in New Issue
Block a user