summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'config.go')
-rw-r--r--config.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/config.go b/config.go
index 796a288..cbe36a1 100644
--- a/config.go
+++ b/config.go
@@ -4,7 +4,6 @@ import (
"github.com/fsnotify/fsnotify"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
- "os"
"random.chars.jp/git/image-board/store"
)
@@ -39,13 +38,11 @@ func configSetup() {
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
err = viper.WriteConfigAs("server.toml")
if err != nil {
- log.Fatalf("Error while generating default configuration, %s", err)
- os.Exit(1)
+ log.Fatalf("Error generating default configuration, %s", err)
}
log.Warn("Generated default server.toml in current directory.")
} else {
- log.Fatalf("Error while loading configuration, %s", err)
- os.Exit(1)
+ log.Fatalf("Error loading configuration, %s", err)
}
}
@@ -86,8 +83,7 @@ func openStore() {
}
instance = store.New(path, single)
if instance == nil {
- log.Fatalf("Unable to initialize store.")
- os.Exit(1)
+ log.Fatalf("Error initializing store.")
}
log.Infof("Store opened on %s revision %v compat %v.", path, instance.Revision, instance.Compat)
info := instance.User(instance.InitialUser)
@@ -99,7 +95,6 @@ func openStore() {
} else {
if single {
log.Fatal("Instance has no initial user, single user mode unavailable.")
- os.Exit(1)
}
}
if single {