Get rid of dynamic errors
This commit is contained in:
parent
25b790d025
commit
d6739386a0
10 changed files with 53 additions and 22 deletions
|
@ -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"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue