fix: better errors

This commit is contained in:
Maas Lalani
2023-06-15 10:52:27 -04:00
parent ae6244ee75
commit 165699944a
2 changed files with 17 additions and 0 deletions

View File

@@ -37,6 +37,9 @@ var rootCmd = &cobra.Command{
if len(to) > 0 && from != "" && subject != "" && body != "" {
err := sendEmail(to, from, subject, body, attachments)
if err != nil {
cmd.SilenceUsage = true
cmd.SilenceErrors = true
fmt.Println(errorStyle.Render(err.Error()))
return err
}
return nil