mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 22:58:25 +00:00
All printed warnings should have some context
This commit is contained in:
parent
d20df12168
commit
1a66461e07
@ -278,7 +278,7 @@ func restPostConfig(m *model.Model, w http.ResponseWriter, r *http.Request) {
|
|||||||
var newCfg config.Configuration
|
var newCfg config.Configuration
|
||||||
err := json.NewDecoder(r.Body).Decode(&newCfg)
|
err := json.NewDecoder(r.Body).Decode(&newCfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Warnln(err)
|
l.Warnln("decoding posted config:", err)
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
@ -289,7 +289,7 @@ func restPostConfig(m *model.Model, w http.ResponseWriter, r *http.Request) {
|
|||||||
} else {
|
} else {
|
||||||
hash, err := bcrypt.GenerateFromPassword([]byte(newCfg.GUI.Password), 0)
|
hash, err := bcrypt.GenerateFromPassword([]byte(newCfg.GUI.Password), 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Warnln(err)
|
l.Warnln("bcrypting password:", err)
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
@ -513,7 +513,7 @@ func restGetLang(w http.ResponseWriter, r *http.Request) {
|
|||||||
func restPostUpgrade(w http.ResponseWriter, r *http.Request) {
|
func restPostUpgrade(w http.ResponseWriter, r *http.Request) {
|
||||||
rel, err := upgrade.LatestRelease(strings.Contains(Version, "-beta"))
|
rel, err := upgrade.LatestRelease(strings.Contains(Version, "-beta"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Warnln(err)
|
l.Warnln("getting latest release:", err)
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -521,7 +521,7 @@ func restPostUpgrade(w http.ResponseWriter, r *http.Request) {
|
|||||||
if upgrade.CompareVersions(rel.Tag, Version) == 1 {
|
if upgrade.CompareVersions(rel.Tag, Version) == 1 {
|
||||||
err = upgrade.UpgradeTo(rel, GoArchExtra)
|
err = upgrade.UpgradeTo(rel, GoArchExtra)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Warnln(err)
|
l.Warnln("upgrading:", err)
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ func trackCPUUsage() {
|
|||||||
for _ = range time.NewTicker(time.Second).C {
|
for _ = range time.NewTicker(time.Second).C {
|
||||||
err := solarisPrusage(pid, &rusage)
|
err := solarisPrusage(pid, &rusage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Warnln(err)
|
l.Warnln("getting prusage:", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
curTime := time.Now().UnixNano()
|
curTime := time.Now().UnixNano()
|
||||||
|
@ -315,7 +315,7 @@ func Load(rd io.Reader, myID protocol.NodeID) (Configuration, error) {
|
|||||||
if len(cfg.GUI.Password) > 0 && cfg.GUI.Password[0] != '$' {
|
if len(cfg.GUI.Password) > 0 && cfg.GUI.Password[0] != '$' {
|
||||||
hash, err := bcrypt.GenerateFromPassword([]byte(cfg.GUI.Password), 0)
|
hash, err := bcrypt.GenerateFromPassword([]byte(cfg.GUI.Password), 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Warnln(err)
|
l.Warnln("bcrypting password:", err)
|
||||||
} else {
|
} else {
|
||||||
cfg.GUI.Password = string(hash)
|
cfg.GUI.Password = string(hash)
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ func (v Simple) Archive(filePath string) error {
|
|||||||
|
|
||||||
versions, err := filepath.Glob(filepath.Join(dir, file+"~*"))
|
versions, err := filepath.Glob(filepath.Join(dir, file+"~*"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Warnln(err)
|
l.Warnln("globbing:", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ func (v Simple) Archive(filePath string) error {
|
|||||||
}
|
}
|
||||||
err = os.Remove(toRemove)
|
err = os.Remove(toRemove)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Warnln(err)
|
l.Warnln("removing old version:", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user