Get rid of dynamic errors

This commit is contained in:
Kristoffer Dalby 2021-11-15 19:18:14 +00:00
parent 25b790d025
commit d6739386a0
No known key found for this signature in database
GPG key ID: 09F62DC067465735
10 changed files with 53 additions and 22 deletions

View file

@ -81,6 +81,7 @@ func LoadConfig(path string) error {
errorText += "Fatal config error: server_url must start with https:// or http://\n"
}
if errorText != "" {
//nolint
return errors.New(strings.TrimSuffix(errorText, "\n"))
} else {
return nil
@ -305,6 +306,8 @@ func getHeadscaleApp() (*headscale.Headscale, error) {
// to avoid races
minInactivityTimeout, _ := time.ParseDuration("65s")
if viper.GetDuration("ephemeral_node_inactivity_timeout") <= minInactivityTimeout {
// TODO: Find a better way to return this text
//nolint
err := fmt.Errorf(
"ephemeral_node_inactivity_timeout (%s) is set too low, must be more than %s",
viper.GetString("ephemeral_node_inactivity_timeout"),