envd
envd copied to clipboard
feat(CLI): Handle error gracefully
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.
- [x] Print stack trace
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 Yep.