idm: Fix error handling on startup (#3243)
* Fix idm to acutally return error during startup to the runtime * Add proper conditon to error log statement
This commit is contained in:
1 parent
ba29635cd8
commit
ccf6bf1b0d
1 file changed
+4
-4
@@ -40,8 +40,7 @@ func Server(cfg *config.Config) *cli.Command {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
defer cancel()
|
defer cancel()
|
||||||
start(ctx, logger, cfg)
|
return start(ctx, logger, cfg)
|
||||||
return nil
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,8 +66,9 @@ func start(ctx context.Context, logger log.Logger, cfg *config.Config) error {
|
|||||||
}
|
}
|
||||||
if _, err := os.Stat(servercfg.BoltDBFile); errors.Is(err, os.ErrNotExist) {
|
if _, err := os.Stat(servercfg.BoltDBFile); errors.Is(err, os.ErrNotExist) {
|
||||||
logger.Debug().Msg("Bootstrapping IDM database")
|
logger.Debug().Msg("Bootstrapping IDM database")
|
||||||
err = bootstrap(logger, cfg, servercfg)
|
if err = bootstrap(logger, cfg, servercfg); err != nil {
|
||||||
logger.Error().Err(err).Msg("failed")
|
logger.Error().Err(err).Msg("failed to bootstrap idm database")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
svc, err := server.NewServer(&servercfg)
|
svc, err := server.NewServer(&servercfg)
|
||||||
|
|||||||
Reference in new issue
Block a user