lib/config, lib/model: Don't warn and return error (#4997)

This commit is contained in:
Simon Frei 2018-06-10 15:41:20 +02:00 committed by GitHub
parent b7234785f8
commit 1e2732aa21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View File

@ -190,9 +190,7 @@ func (f *FolderConfiguration) CreateRoot() (err error) {
filesystem := f.Filesystem()
if _, err = filesystem.Stat("."); fs.IsNotExist(err) {
if err = filesystem.MkdirAll(".", permBits); err != nil {
l.Warnf("Creating directory for %v: %v", f.Description(), err)
}
err = filesystem.MkdirAll(".", permBits)
}
return err

View File

@ -231,13 +231,10 @@ func (m *Model) startFolderLocked(folder string) config.FolderType {
// if these things don't work, we still want to start the folder and
// it'll show up as errored later.
// Directory permission bits. Will be filtered down to something
// sane by umask on Unixes.
cfg.CreateRoot()
if err := cfg.CreateMarker(); err != nil {
l.Warnln("Creating folder marker:", err)
if err := cfg.CreateRoot(); err != nil {
l.Warnln("Failed to create folder root directory", err)
} else if err = cfg.CreateMarker(); err != nil {
l.Warnln("Failed to create folder marker:", err)
}
}