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

This commit is contained in:
samosvalishe
2026-08-17 18:45:31 +03:00
parent d208a0d3df
commit 5fdd8c3112
2 changed files with 10 additions and 8 deletions
@@ -78,5 +78,6 @@ func IsAuthError(err error) bool {
strings.Contains(s, "Unauthorized") ||
strings.Contains(s, "authentication") ||
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()
cases := map[string]bool{
"401 Unauthorized": true,
"alloc failed: 401": true,
"stale nonce": true,
"invalid credential": true,
"authentication required": true,
"connection refused": false,
"": false,
"401 Unauthorized": true,
"alloc failed: 401": true,
"stale nonce": true,
"invalid credential": true,
"authentication required": true,
"486: Allocation Quota Reached": true,
"connection refused": false,
"": false,
}
for msg, want := range cases {
got := IsAuthError(errors.New(msg))