Handle errors in filestore init (#127)

Fixes issue #108
This commit is contained in:
Soam Vasani
2017-02-17 15:21:36 -08:00
committed by GitHub
parent ab6e2e8021
commit 8cf382c2b3
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -62,6 +62,9 @@ func MakeFileStore(path string) *FileStore {
return nil
}
log.Printf("Created directory %v", path)
} else {
log.Printf("Unknown error initializing filestore: %v", err)
return nil
}
}
+3
View File
@@ -14,6 +14,9 @@ import (
func runController(port int, etcdUrl string, filepath string) {
// filePath will be created if it doesn't exist.
fileStore := controller.MakeFileStore(filepath)
if fileStore == nil {
log.Fatalf("Failed to initialize filestore")
}
rs, err := controller.MakeResourceStore(fileStore, []string{etcdUrl})
if err != nil {