Add standalone GusVoice AWG bot and Linux installer

This commit is contained in:
wenil committed 2026-10-30 14:44:04 +03:00
commit 38c6a1a682
23 files changed
+2924

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
# SPDX-License-Identifier: MIT
"""Errors of the GusVoice Bot API client."""
from __future__ import annotations
from typing import Optional
class GusVoiceError(Exception):
"""Base class of every error raised by this package."""
class GusVoiceApiError(GusVoiceError):
"""The server answered `{"ok": false, ...}` (or a non-JSON error page).
`code` is `error_code` (or the HTTP status), `description` is the server text, `retry_after` (seconds) comes with 429.
"""
def __init__(self, code: int, description: str, retry_after: Optional[int] = None, method: Optional[str] = None) -> None:
self.code = code
self.description = description
self.retry_after = retry_after
self.method = method
where = f"{method}: " if method else ""
super().__init__(f"{where}{code} {description}")