app/vmauth: emit fatal errors instead of panics when incorrect command-line flags are set

This commit is contained in:
Aliaksandr Valialkin 2020-06-05 20:13:03 +03:00
parent 4e8d6b80e0
commit 4b98e436ef

View file

@ -36,11 +36,11 @@ type UserInfo struct {
func initAuthConfig() { func initAuthConfig() {
if len(*authConfigPath) == 0 { if len(*authConfigPath) == 0 {
logger.Panicf("FATAL: missing required `-auth.config` command-line flag") logger.Fatalf("missing required `-auth.config` command-line flag")
} }
m, err := readAuthConfig(*authConfigPath) m, err := readAuthConfig(*authConfigPath)
if err != nil { if err != nil {
logger.Panicf("FATAL: cannot load auth config from `-auth.config=%s`: %s", *authConfigPath, err) logger.Fatalf("cannot load auth config from `-auth.config=%s`: %s", *authConfigPath, err)
} }
authConfig.Store(m) authConfig.Store(m)
stopCh = make(chan struct{}) stopCh = make(chan struct{})