Better offline handling, implemented the local portion of delete, and maybe fixed the bug when running tests on github actions

This commit is contained in:
David Dworken
2022-09-18 09:42:24 -07:00
parent 6c6acc5473
commit 1bf510ff8a
5 changed files with 59 additions and 7 deletions

View File

@ -1055,6 +1055,9 @@ func ApiPost(path, contentType string, data []byte) ([]byte, error) {
}
func IsOfflineError(err error) bool {
if err == nil {
return false
}
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")
}