Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2022-07-20 19:58:45 +08:00
commit c624c9f60c
3 changed files with 13 additions and 12 deletions

View file

@ -39,10 +39,10 @@ require (
github.com/panjf2000/ants/v2 v2.5.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/radovskyb/watcher v1.0.7
github.com/siyuan-note/dejavu v0.0.0-20220719151948-d0acac8964fd
github.com/siyuan-note/dejavu v0.0.0-20220720101007-753f2e22d6e8
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75
github.com/siyuan-note/eventbus v0.0.0-20220624162334-ca7c06dc771f
github.com/siyuan-note/filelock v0.0.0-20220704090116-54dfb035283f
github.com/siyuan-note/filelock v0.0.0-20220720085501-7eb29d8a394b
github.com/siyuan-note/httpclient v0.0.0-20220709030145-2bfb50f28e73
github.com/siyuan-note/logging v0.0.0-20220717040626-f796b05ee520
github.com/steambap/captcha v1.4.1

View file

@ -515,14 +515,14 @@ github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYED
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/siyuan-note/dejavu v0.0.0-20220719151948-d0acac8964fd h1:yJe5KlGeBPfeUgmiMMLpQfPoE8KtTcBbfU6MWBar2Lg=
github.com/siyuan-note/dejavu v0.0.0-20220719151948-d0acac8964fd/go.mod h1:0VEmTSMPoFer5yCQ4ozkjC0YX1rpK7BEJ0IwXI2cqf0=
github.com/siyuan-note/dejavu v0.0.0-20220720101007-753f2e22d6e8 h1:/hAzW5KxJtC2vYGPzuNGOKYpzusqpW0cjYWMjBvMGcM=
github.com/siyuan-note/dejavu v0.0.0-20220720101007-753f2e22d6e8/go.mod h1:km5Yx+EA/xsCLSidsh/YdOvRV9+mDi6POyU5e2il0ks=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75 h1:Bi7/7f29LW+Fm0cHc0J1NO1cZqyJwljSWVmfOqVZgaE=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw=
github.com/siyuan-note/eventbus v0.0.0-20220624162334-ca7c06dc771f h1:JMobMNZ7AqaKKyEK+WeWFhix/2TDQXgPZDajU00IybU=
github.com/siyuan-note/eventbus v0.0.0-20220624162334-ca7c06dc771f/go.mod h1:Sqo4FYX5lAXu7gWkbEdJF0e6P57tNNVV4WDKYDctokI=
github.com/siyuan-note/filelock v0.0.0-20220704090116-54dfb035283f h1:IXZ4SWPjQLqMrBwDWcWYFE/SihUHRS9FYhk/0bnySok=
github.com/siyuan-note/filelock v0.0.0-20220704090116-54dfb035283f/go.mod h1:c4vwvWRrnfa75OXiO21K/76BFRJ4cFITKNoVs5lFdwc=
github.com/siyuan-note/filelock v0.0.0-20220720085501-7eb29d8a394b h1:V6302ftza/vR3oIpiOydxdB0/MfAs8jyrw6LGhMGcVg=
github.com/siyuan-note/filelock v0.0.0-20220720085501-7eb29d8a394b/go.mod h1:c4vwvWRrnfa75OXiO21K/76BFRJ4cFITKNoVs5lFdwc=
github.com/siyuan-note/httpclient v0.0.0-20220709030145-2bfb50f28e73 h1:NAw9IJtD0/NU2lhraQjELAcU9Bf6mRLrhvx57Q3qmsw=
github.com/siyuan-note/httpclient v0.0.0-20220709030145-2bfb50f28e73/go.mod h1:sCMZurEZaMFiwGbdppizHT3NPO/HUdd+1FqtAyfdEsE=
github.com/siyuan-note/logging v0.0.0-20220717040626-f796b05ee520 h1:kscYjMt7jXYdd7Qj2OSUoBnoHc5B0U/E6OSx86VRLr4=

View file

@ -312,17 +312,18 @@ func ListCloudSyncDir() (syncDirs []*Sync, hSize string, err error) {
func formatErrorMsg(err error) string {
msg := err.Error()
if strings.Contains(msg, "Permission denied") || strings.Contains(msg, "Access is denied") {
msgLowerCase := strings.ToLower(msg)
if strings.Contains(msgLowerCase, "permission denied") || strings.Contains(msg, "access is denied") {
msg = Conf.Language(33) + " " + err.Error()
} else if strings.Contains(msg, "Device or resource busy") {
} else if strings.Contains(msgLowerCase, "device or resource busy") {
msg = Conf.Language(85) + " " + err.Error()
} else if strings.Contains(msg, "cipher: message authentication failed") {
} else if strings.Contains(msgLowerCase, "cipher: message authentication failed") {
msg = Conf.Language(172) + " " + err.Error()
} else if strings.Contains(msg, "repo fatal error") {
} else if strings.Contains(msgLowerCase, "repo fatal error") {
msg = Conf.Language(23) + " " + err.Error()
} else if strings.Contains(msg, "no such host") || strings.Contains(msg, "connection failed") {
} else if strings.Contains(msgLowerCase, "no such host") || strings.Contains(msgLowerCase, "connection failed") {
msg = Conf.Language(24)
} else if strings.Contains(msg, "net/http: request canceled while waiting for connection") {
} else if strings.Contains(msgLowerCase, "net/http: request canceled while waiting for connection") {
msg = Conf.Language(24) + " net/http timeout"
}
msg = msg + " v" + util.Ver