all: Add failure reporting (fixes #7028) (#6925)

This commit is contained in:
Simon Frei
2020-10-07 10:05:13 +02:00
committed by GitHub
parent b1db328931
commit 9d09fd6af3
10 changed files with 356 additions and 85 deletions
+6 -1
View File
@@ -21,7 +21,7 @@ import (
"github.com/syncthing/syncthing/lib/util"
)
type EventType int
type EventType int64
const (
Starting EventType = 1 << iota
@@ -52,6 +52,7 @@ const (
FolderWatchStateChanged
ListenAddressesChanged
LoginAttempt
Failure
AllEvents = (1 << iota) - 1
)
@@ -121,6 +122,8 @@ func (t EventType) String() string {
return "LoginAttempt"
case FolderWatchStateChanged:
return "FolderWatchStateChanged"
case Failure:
return "Failure"
default:
return "Unknown"
}
@@ -200,6 +203,8 @@ func UnmarshalEventType(s string) EventType {
return LoginAttempt
case "FolderWatchStateChanged":
return FolderWatchStateChanged
case "Failure":
return Failure
default:
return 0
}