iroha icon indicating copy to clipboard operation
iroha copied to clipboard

Better error messages for KeyPair

Open appetrosyan opened this issue 3 years ago • 3 comments

When trying to decode a key from a hex representation that has an odd number of digits, the error message contains only that: that there's an odd number of digits. We need to ensure that all error cases wherein the key fails to get decoded is handled properly and provides feedback to the user.

appetrosyan avatar Aug 04 '22 20:08 appetrosyan

this might have been handled by Ursa replacement

mversic avatar Dec 07 '23 12:12 mversic

The current implementation of key decoding in the configuration setup yields a uniform error message for various types of input errors. This uniform error message does not provide enough context or guidance for troubleshooting the specific cause of the failure. The cases include but are not limited to odd number of digits in hex representation, invalid characters, incorrect key length, presence of spaces or special characters, and others. The error message encountered in all these scenarios is:

Error: 
   0: Failed to finalize configuration
   1: Failed to build `Configuration` from `ConfigurationProxy`
   2: Please add `public_key` to the configuration

Location:
   config/src/client.rs:171

AlexStroke avatar Jan 17 '24 07:01 AlexStroke

  • [ ] Use a key with invalid characters (non-hex)
  • [ ] Input a key that is too short or too long
  • [ ] Insert spaces or special characters in the key

AlexStroke avatar Jan 17 '24 07:01 AlexStroke