Treat EOF error as an offline error

This commit is contained in:
David Dworken 2022-09-10 18:07:45 -07:00
parent c190b80837
commit 5a38a4a754

View File

@ -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 {