Skip to content

Commit d34aaf9

Browse files
Slightly changed error messages
1 parent b8408a5 commit d34aaf9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cmd/goso/cli.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ func root(args []string) error {
6464
} else {
6565
qn, err = strconv.Atoi(q)
6666
if err != nil {
67-
return fmt.Errorf("-q should be within [min=1, max=10], please check your env")
67+
return fmt.Errorf("-q should be within [min=1, max=10], please check if `GOSO_QUESTIONS` is set correctly")
6868
}
6969
if qn < 1 || qn > 10 {
70-
return fmt.Errorf("-q should be within [min=1, max=10], please check your env")
70+
return fmt.Errorf("-q should be within [min=1, max=10], please check if `GOSO_QUESTIONS` is set correctly")
7171
}
7272
}
7373
a, set := os.LookupEnv("GOSO_ANSWERS")
@@ -76,10 +76,10 @@ func root(args []string) error {
7676
} else {
7777
an, err = strconv.Atoi(a)
7878
if err != nil {
79-
return fmt.Errorf("-a should be within [min=1, max=10], please check your env")
79+
return fmt.Errorf("-a should be within [min=1, max=10], please check if `GOSO_ANSWERS` is set correctly")
8080
}
8181
if an < 1 || an > 10 {
82-
return fmt.Errorf("-a should be within [min=1, max=10], please check your env")
82+
return fmt.Errorf("-a should be within [min=1, max=10], please check if `GOSO_ANSWERS` is set correctly")
8383
}
8484
}
8585
flags := flag.NewFlagSet(app, flag.ExitOnError)

goso.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func FetchGoogle(conf *Config) (*GoogleSearchResult, error) {
329329
}
330330
res, err := conf.Client.Do(req)
331331
if err != nil {
332-
return nil, err
332+
return nil, fmt.Errorf("failed connecting to Google API: check you internet connection")
333333
}
334334
defer res.Body.Close()
335335
if res.StatusCode > 299 {

0 commit comments

Comments
 (0)