Don't silently fail on watcher creation

This commit is contained in:
Maran 2014-07-14 15:29:02 +02:00
parent e6a428f85f
commit dce0ccf490

View File

@ -8,7 +8,6 @@ import (
"github.com/go-qml/qml" "github.com/go-qml/qml"
"github.com/howeyc/fsnotify" "github.com/howeyc/fsnotify"
"io/ioutil" "io/ioutil"
"log"
"net/url" "net/url"
"os" "os"
"path" "path"
@ -77,11 +76,13 @@ func (app *HtmlApplication) NewWatcher(quitChan chan bool) {
app.watcher, err = fsnotify.NewWatcher() app.watcher, err = fsnotify.NewWatcher()
if err != nil { if err != nil {
logger.Infoln("Could not create new auto-reload watcher:", err)
return return
} }
err = app.watcher.Watch(app.RootFolder()) err = app.watcher.Watch(app.RootFolder())
if err != nil { if err != nil {
log.Fatal(err) logger.Infoln("Could not start auto-reload watcher:", err)
return
} }
for _, folder := range app.RecursiveFolders() { for _, folder := range app.RecursiveFolders() {
fullPath := app.RootFolder() + "/" + folder.Name() fullPath := app.RootFolder() + "/" + folder.Name()