metaplex-foundation / sugar

Candy Machine Rust CLI.
Apache License 2.0
200 stars 113 forks source link

Improve deserialization error messages on create-config #201

Closed MarkSackerberg closed 2 years ago

MarkSackerberg commented 2 years ago

Issue description

When running sugar create-config it directly aborts with the following error message:

sugar create-config
[1/2] 🍬 Sugar interactive config maker

Check out our Candy Machine config docs to learn about the options:
  -> https://docs.metaplex.com/candy-machine-v2/configuration

🛑 Error running command (re-run needed): invalid type: map, expected a sequence at line 7 column 18

sugar upload is resulting in the same error.

content of sugar.log attached.

Relevant log output

{"v":0,"name":"sugar","msg":"Lend me some sugar, I am your neighbor.","level":30,"hostname":"DESKTOP-97CGC42","pid":16973,"time":"2022-05-11T16:04:09.96045496Z","target":"sugar","line":101,"file":"src/main.rs"}

Priority this issue should have

Low (slightly annoying)

stranzhay commented 2 years ago

I am unable to repro, seeing if anyone else can rn

febo commented 2 years ago

The problem reported was caused by a malformed metadata file, since the create-config tries to load the 0.json file if present. We need to improve the error reporting for deserialization errors - at a minimum, report which file generated the problem.