mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-02 11:39:24 +01:00
Treat EOF error as an offline error
This commit is contained in:
parent
c190b80837
commit
5a38a4a754
@ -938,7 +938,7 @@ func ApiPost(path, contentType string, data []byte) ([]byte, error) {
|
||||
}
|
||||
|
||||
func IsOfflineError(err error) bool {
|
||||
return strings.Contains(err.Error(), "dial tcp: lookup api.hishtory.dev") || strings.Contains(err.Error(), "read: connection reset by peer")
|
||||
return strings.Contains(err.Error(), "dial tcp: lookup api.hishtory.dev") || strings.Contains(err.Error(), "read: connection reset by peer") || strings.Contains(err.Error(), ": EOF")
|
||||
}
|
||||
|
||||
func ReliableDbCreate(db *gorm.DB, entry interface{}) error {
|
||||
|
Loading…
Reference in New Issue
Block a user