ЛР2 на 3

Co-authored-by: Югай Артур Рустамович <f1ekserr@yandex.ru>
This commit is contained in:
2026-11-16 22:19:31 +03:00
co-authored by Югай Артур Рустамович
parent 65003b6119
commit 8e06e7634f
29 changed files with 1784 additions and 34 deletions
+14
View File
@@ -0,0 +1,14 @@
class ApiError(Exception):
def __init__(self, status, code, message):
super().__init__(message)
self.status = status
self.code = code
self.message = message
def invalid(message="Неверный запрос"):
return ApiError(400, "invalid_request", message)
def not_found():
return ApiError(404, "not_found", "Объект не найден")