Skip to content

Commit

Permalink
feat: better looking error msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
TypicalAM committed Dec 19, 2023
1 parent 6c61481 commit ee39877
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cmd/goread/goread.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var (
Short: "goread - a fancy TUI for reading RSS/Atom feeds",
Run: func(cmd *cobra.Command, args []string) {
if err := Run(); err != nil {
fmt.Fprintf(os.Stderr, "There has been an error executing the commands: '%s'", err)
fmt.Fprintf(os.Stderr, errStyle.Render("There has been an error executing the commands: '%s'"), err)
os.Exit(1)
}
},
Expand Down Expand Up @@ -71,7 +71,7 @@ func SetVersion(version string) {
// Execute executes the commands
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "There has been an error executing the commands: '%s'", err)
fmt.Fprintf(os.Stderr, errStyle.Render("There has been an error executing the commands: '%s'"), err)
os.Exit(1)
}
}
Expand Down Expand Up @@ -106,7 +106,6 @@ func Run() error {
if opts.dumpColors {
if err := colors.Save(); err != nil {
log.Println("Failed to save colorscheme: ", err)
fmt.Println(errStyle.Render("Failed to save the colorscheme"))
return err
}

Expand Down Expand Up @@ -157,7 +156,6 @@ func Run() error {
log.Println("Loading OPML file: ", opts.loadOPMLFrom)

if err := backend.Rss.LoadOPML(opts.loadOPMLFrom); err != nil {
fmt.Println(errStyle.Render("Loaded OPML file failed"))
return err
}

Expand All @@ -170,7 +168,6 @@ func Run() error {
log.Println("Exporting OPML file to: ", opts.exportOPMLTo)

if err := backend.Rss.ExportOPML(opts.exportOPMLTo); err != nil {
fmt.Println(errStyle.Render("Exporting OPML file failed"))
return err
}

Expand Down

0 comments on commit ee39877

Please sign in to comment.