ux: Improve error message when endpoint is invalid

This commit is contained in:
TwiN 2022-09-01 20:51:37 -04:00
parent c84ae1cd55
commit 5c6bf84106

View File

@ -2,6 +2,7 @@ package config
import (
"errors"
"fmt"
"log"
"os"
"time"
@ -267,7 +268,7 @@ func validateEndpointsConfig(config *Config) error {
log.Printf("[config][validateEndpointsConfig] Validating endpoint '%s'", endpoint.Name)
}
if err := endpoint.ValidateAndSetDefaults(); err != nil {
return err
return fmt.Errorf("invalid endpoint %s: %s", endpoint.DisplayName(), err)
}
}
log.Printf("[config][validateEndpointsConfig] Validated %d endpoints", len(config.Endpoints))