forked from cerc-io/plugeth
Don't silently fail on watcher creation
This commit is contained in:
parent
e6a428f85f
commit
dce0ccf490
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user