fix(vkauth): ловим 486 как auth-error для рецикла аллокации

This commit is contained in:
samosvalishe committed 2026-08-17 18:45:31 +03:00
1 parent d208a0d3df
commit 5fdd8c3112
2 files changed
+10 -8

No files matched your search

@@ -78,5 +78,6 @@ func IsAuthError(err error) bool {
strings.Contains(s, "Unauthorized") || strings.Contains(s, "Unauthorized") ||
strings.Contains(s, "authentication") || strings.Contains(s, "authentication") ||
strings.Contains(s, "invalid credential") || strings.Contains(s, "invalid credential") ||
strings.Contains(s, "stale nonce") strings.Contains(s, "stale nonce") ||
strings.Contains(s, "486")
} }
@@ -31,13 +31,14 @@ func TestIsAuthError(t *testing.T) {
t.Parallel() t.Parallel()
cases := map[string]bool{ cases := map[string]bool{
"401 Unauthorized": true, "401 Unauthorized": true,
"alloc failed: 401": true, "alloc failed: 401": true,
"stale nonce": true, "stale nonce": true,
"invalid credential": true, "invalid credential": true,
"authentication required": true, "authentication required": true,
"connection refused": false, "486: Allocation Quota Reached": true,
"": false, "connection refused": false,
"": false,
} }
for msg, want := range cases { for msg, want := range cases {
got := IsAuthError(errors.New(msg)) got := IsAuthError(errors.New(msg))