[skip ci] update error messages

This commit is contained in:
Dan Anglin 2024-08-20 00:07:43 +01:00
parent 72caa3efb4
commit ced5a4e6eb
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638

View file

@ -37,22 +37,22 @@ func (v *TimeDurationValue) Set(value string) error {
case strings.Contains(matches[ind], "day"): case strings.Contains(matches[ind], "day"):
days, err = parseInt(matches[ind]) days, err = parseInt(matches[ind])
if err != nil { if err != nil {
return fmt.Errorf("unable to parse the integer from %s: %w", matches[ind], err) return fmt.Errorf("unable to parse the number of days from %s: %w", matches[ind], err)
} }
case strings.Contains(matches[ind], "hour"): case strings.Contains(matches[ind], "hour"):
hours, err = parseInt(matches[ind]) hours, err = parseInt(matches[ind])
if err != nil { if err != nil {
return fmt.Errorf("unable to parse the integer from %s: %w", matches[ind], err) return fmt.Errorf("unable to parse the number of hours from %s: %w", matches[ind], err)
} }
case strings.Contains(matches[ind], "minute"): case strings.Contains(matches[ind], "minute"):
minutes, err = parseInt(matches[ind]) minutes, err = parseInt(matches[ind])
if err != nil { if err != nil {
return fmt.Errorf("unable to parse the integer from %s: %w", matches[ind], err) return fmt.Errorf("unable to parse the number of minutes from %s: %w", matches[ind], err)
} }
case strings.Contains(matches[ind], "second"): case strings.Contains(matches[ind], "second"):
seconds, err = parseInt(matches[ind]) seconds, err = parseInt(matches[ind])
if err != nil { if err != nil {
return fmt.Errorf("unable to parse the integer from %s: %w", matches[ind], err) return fmt.Errorf("unable to parse the number of seconds from %s: %w", matches[ind], err)
} }
} }
} }