Skip to content

Commit

Permalink
improve error messages (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhowden authored Nov 30, 2021
1 parent 386dafe commit 98fcc0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions env.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (v *intValue) Set(x string) error {
*v = intValue(n)
if err != nil {
if ne, ok := err.(*strconv.NumError); ok {
return errors.New("parsing " + strconv.Quote(ne.Num) + ": " + ne.Err.Error())
return errors.New("invalid integer " + strconv.Quote(ne.Num) + ": " + ne.Err.Error())
}
}
return err
Expand All @@ -80,7 +80,7 @@ func (v *int64Value) Set(x string) error {
*v = int64Value(n)
if err != nil {
if ne, ok := err.(*strconv.NumError); ok {
return errors.New("parsing " + strconv.Quote(ne.Num) + ": " + ne.Err.Error())
return errors.New("invalid 64-bit integer " + strconv.Quote(ne.Num) + ": " + ne.Err.Error())
}
}
return err
Expand Down Expand Up @@ -119,7 +119,7 @@ func (v *boolValue) Set(x string) error {
*v = boolValue(b)
if err != nil {
if ne, ok := err.(*strconv.NumError); ok {
return errors.New("parsing " + strconv.Quote(ne.Num) + ": " + ne.Err.Error())
return errors.New("invalid bool " + strconv.Quote(ne.Num) + ": " + ne.Err.Error())
}
}
return err
Expand Down

0 comments on commit 98fcc0e

Please sign in to comment.