all: Get rid of fatal logging (#5537)

* cleanup Fatal in lib/config/config.go

* cleanup Fatal in lib/config/folderconfiguration.go

* cleanup Fatal in lib/model/model.go

* cleanup Fatal in cmd/syncthing/monitor.go

* cleanup Fatal in cmd/syncthing/main.go

* cleanup Fatal in lib/api

* remove Fatal methods from logger

* lowercase in errors.Wrap

* one less channel
This commit is contained in:
Simon Frei
2019-02-14 21:29:14 +01:00
committed by Audrius Butkevicius
parent 7a40c42e8b
commit d5ff2c41dc
7 changed files with 139 additions and 88 deletions

View File

@@ -923,7 +923,7 @@ func (m *Model) handleIndex(deviceID protocol.DeviceID, folder string, fs []prot
m.fmut.RUnlock()
if !existing {
l.Fatalf("%v for nonexistent folder %q", op, folder)
panic(fmt.Sprintf("%v for nonexistent folder %q", op, folder))
}
if running {
@@ -931,7 +931,7 @@ func (m *Model) handleIndex(deviceID protocol.DeviceID, folder string, fs []prot
} else if update {
// Runner may legitimately not be set if this is the "cleanup" Index
// message at startup.
l.Fatalf("%v for not running folder %q", op, folder)
panic(fmt.Sprintf("%v for not running folder %q", op, folder))
}
m.pmut.RLock()