envd icon indicating copy to clipboard operation
envd copied to clipboard

feat(CLI): Handle error gracefully

Open gaocegege opened this issue 3 years ago • 3 comments

Description

Now we print an error when the command fails. But the error may be printed more than once and the format is not user-friendly. We need to have a better mechanism for it.

gaocegege avatar May 16 '22 04:05 gaocegege

  • [x] Print stack trace

VoVAllen avatar May 20 '22 08:05 VoVAllen

But the error may be printed more than once and the format is not user-friendly.

Do you mean this?

$ envd images remove -i envd-quick-start:abnc
ERRO[2022-10-13T19:27:57+08:00] failed to remove image envd-quick-start:abnc  error="Error: No such image: envd-quick-start:abnc"
error: Error: No such image: envd-quick-start:abnc

This case happens because we use errors.Newf and logrus.Errorf at the same time.

Triple-Z avatar Oct 13 '22 11:10 Triple-Z

@Triple-Z Yep.

gaocegege avatar Oct 14 '22 00:10 gaocegege