Skip to content

Commit

Permalink
Slightly changed error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowy-pycoder committed Nov 16, 2024
1 parent b8408a5 commit d34aaf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cmd/goso/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ func root(args []string) error {
} else {
qn, err = strconv.Atoi(q)
if err != nil {
return fmt.Errorf("-q should be within [min=1, max=10], please check your env")
return fmt.Errorf("-q should be within [min=1, max=10], please check if `GOSO_QUESTIONS` is set correctly")
}
if qn < 1 || qn > 10 {
return fmt.Errorf("-q should be within [min=1, max=10], please check your env")
return fmt.Errorf("-q should be within [min=1, max=10], please check if `GOSO_QUESTIONS` is set correctly")
}
}
a, set := os.LookupEnv("GOSO_ANSWERS")
Expand All @@ -76,10 +76,10 @@ func root(args []string) error {
} else {
an, err = strconv.Atoi(a)
if err != nil {
return fmt.Errorf("-a should be within [min=1, max=10], please check your env")
return fmt.Errorf("-a should be within [min=1, max=10], please check if `GOSO_ANSWERS` is set correctly")
}
if an < 1 || an > 10 {
return fmt.Errorf("-a should be within [min=1, max=10], please check your env")
return fmt.Errorf("-a should be within [min=1, max=10], please check if `GOSO_ANSWERS` is set correctly")
}
}
flags := flag.NewFlagSet(app, flag.ExitOnError)
Expand Down
2 changes: 1 addition & 1 deletion goso.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func FetchGoogle(conf *Config) (*GoogleSearchResult, error) {
}
res, err := conf.Client.Do(req)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed connecting to Google API: check you internet connection")
}
defer res.Body.Close()
if res.StatusCode > 299 {
Expand Down

0 comments on commit d34aaf9

Please sign in to comment.