mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-09 23:17:55 +02:00
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:
@ -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")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user