Skip to content

Commit 2f44d1c

Browse files
committed
v1.8.9 — verbose ERROR log when Server error retries exhausted
1 parent 7a1af1c commit 2f44d1c

4 files changed

Lines changed: 25 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/),
66
and this project adheres to [Semantic Versioning](https://semver.org/).
77

8+
## [1.8.9] - 2026-03-05
9+
10+
### Improved
11+
- After all retry attempts exhausted on `"Server error"`, an **ERROR**-level log is now emitted with method name, attempt count, error description, and request params (token excluded) — makes debugging server-side failures much easier
12+
813
## [1.8.8] - 2026-03-04
914

1015
### Fixed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "vkworkspace"
7-
version = "1.8.8"
7+
version = "1.8.9"
88
description = "Fully async framework for building VK Teams (VK Workspace) bots, inspired by aiogram 3"
99
readme = "README.md"
1010
license = { text = "MIT" }

vkworkspace/__meta__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "1.8.8"
1+
__version__ = "1.8.9"
22
__api_version__ = "v1"

vkworkspace/client/bot.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,27 @@ async def _request(
212212
description = data.get("description", "Unknown error")
213213
err = VKTeamsAPIError(method=endpoint, message=description)
214214
# "Server error: id=0x..." = server-side crash, retry like 5xx
215-
if description.startswith("Server error") and attempt < max_attempts - 1:
216-
last_exc = err
217-
delay = min(2**attempt, 8)
218-
logger.warning(
219-
"Server error from %s (attempt %d/%d), retrying in %ds...",
215+
if description.startswith("Server error"):
216+
if attempt < max_attempts - 1:
217+
last_exc = err
218+
delay = min(2**attempt, 8)
219+
logger.warning(
220+
"Server error from %s (attempt %d/%d), retrying in %ds...",
221+
endpoint,
222+
attempt + 1,
223+
max_attempts,
224+
delay,
225+
)
226+
await asyncio.sleep(delay)
227+
continue
228+
logger.error(
229+
"Server error from %s persisted after %d attempts: %s "
230+
"(params: %s)",
220231
endpoint,
221-
attempt + 1,
222232
max_attempts,
223-
delay,
233+
description,
234+
{k: v for k, v in params.items() if k != "token"},
224235
)
225-
await asyncio.sleep(delay)
226-
continue
227236
raise err
228237
return data
229238
except httpx.HTTPStatusError as exc:

0 commit comments

Comments
 (0)