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
1 changed files with 3 additions and 2 deletions

View File

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