🐛 网络超时导致同步失败时提示报错异常 Fix https://github.com/siyuan-note/siyuan/issues/6265

This commit is contained in:
Liang Ding 2022-10-19 17:53:39 +08:00
parent 4e27798f53
commit 4aec262a86
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 25 additions and 25 deletions

View file

@ -351,7 +351,7 @@ func formatErrorMsg(err error) string {
msg = Conf.Language(23)
} else if strings.Contains(msgLowerCase, "no such host") || strings.Contains(msgLowerCase, "connection failed") || strings.Contains(msgLowerCase, "hostname resolution") || strings.Contains(msgLowerCase, "No address associated with hostname") {
msg = Conf.Language(24)
} else if strings.Contains(msgLowerCase, "net/http: request canceled while waiting for connection") || strings.Contains(msgLowerCase, "exceeded while awaiting") || strings.Contains(msgLowerCase, "context deadline exceeded") {
} else if strings.Contains(msgLowerCase, "net/http: request canceled while waiting for connection") || strings.Contains(msgLowerCase, "exceeded while awaiting") || strings.Contains(msgLowerCase, "context deadline exceeded") || strings.Contains(msgLowerCase, "timeout") || strings.Contains(msgLowerCase, "context cancellation while reading body") {
msg = Conf.Language(24)
} else if strings.Contains(msgLowerCase, "connection was") || strings.Contains(msgLowerCase, "reset by peer") || strings.Contains(msgLowerCase, "refused") || strings.Contains(msgLowerCase, "socket") {
msg = Conf.Language(28)