Log and exit when templates init fails

This commit is contained in:
Matt Baer 2019-01-18 19:17:10 -05:00
parent 53a51be578
commit 5c19d249b6
1 changed files with 6 additions and 2 deletions

8
app.go
View File

@ -337,11 +337,15 @@ func Serve() {
isSingleUser = app.cfg.App.SingleUser
app.cfg.Server.Dev = *debugPtr
initTemplates(app.cfg)
err := initTemplates(app.cfg)
if err != nil {
log.Error("load templates: %s", err)
os.Exit(1)
}
// Load keys
log.Info("Loading encryption keys...")
err := initKeys(app)
err = initKeys(app)
if err != nil {
log.Error("\n%s\n", err)
}