mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 05:04:05 -08:00
Merge pull request #772 from prometheus/fabxc/dur-panic
util/strutil: do not panic on wrong duration unit.
This commit is contained in:
commit
7943aa834c
|
@ -78,7 +78,7 @@ func StringToDuration(durationStr string) (duration time.Duration, err error) {
|
||||||
case "s":
|
case "s":
|
||||||
duration *= 1
|
duration *= 1
|
||||||
default:
|
default:
|
||||||
panic("Invalid time unit in duration string.")
|
return 0, fmt.Errorf("invalid time unit in duration string: %q", unit)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue