aptos-labs / aptos-core

Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
https://aptosfoundation.org
Other
6.17k stars 3.64k forks source link

[DevEx] (minor) More informative error message when ~/.aptos/config.yaml is malformed #10451

Open xbtmatt opened 1 year ago

xbtmatt commented 1 year ago

DevEx issue, CLI

When your config.yaml aptos CLI profiles file is malformed, you get this error:

{
  "Error": "Unexpected error: while parsing a block mapping, did not find expected key at line 219 column 87"
}

Confused me for about 5-10 mins before realizing what the issue was. Would be nice to have a more informative error message

To reproduce

add random characters to your ~/.aptos/config.yaml file and try to run something that requires a --named-addresses flag

nhd98z commented 1 month ago

I got the same problem when copying keys from json file to config.yaml, turn out I have to delete the "," of json file.

private_key: "xxx", <= remove this ,