[skip ci] update error messages
This commit is contained in:
parent
72caa3efb4
commit
ced5a4e6eb
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue