When no database or config is found the program exits
the build was successful Details

This commit is contained in:
kolaente 2017-12-05 16:06:40 +01:00
parent 5968e4e56e
commit 22ee38f7b4
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 3 additions and 1 deletions

View File

@ -23,12 +23,14 @@ func main() {
err := models.SetConfig() err := models.SetConfig()
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
os.Exit(1)
} }
// Set Engine // Set Engine
err = models.SetEngine() err = models.SetEngine()
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
os.Exit(1)
} }
// Start the webserver // Start the webserver

View File

@ -27,7 +27,7 @@ type ConfigStruct struct {
var Config = new(ConfigStruct) var Config = new(ConfigStruct)
// SetConfig initianlises the config and publishes it for other functions to use // SetConfig initianlises the config and publishes it for other functions to use
func SetConfig() error { func SetConfig() (err error) {
// File Checks // File Checks
if _, err := os.Stat("config.ini"); os.IsNotExist(err) { if _, err := os.Stat("config.ini"); os.IsNotExist(err) {