- Introduced `DependenciesMiddleware` and `BlacklistMiddleware` for enhanced request handling across all routers. - Refactored admin handlers to utilize new middleware, improving access control and error handling. - Updated the `admin_router` to include middleware for access checks and streamlined the process of banning users. - Enhanced the structure of admin handler imports for better organization and maintainability. - Improved error handling in various admin functions to ensure robust user interactions.
24 lines
783 B
Python
24 lines
783 B
Python
class UserBlockedBotError(Exception):
|
|
"""Исключение, возникающее когда пользователь заблокировал бота"""
|
|
pass
|
|
|
|
|
|
class PostNotFoundError(Exception):
|
|
"""Исключение, возникающее когда пост не найден в базе данных"""
|
|
pass
|
|
|
|
|
|
class UserNotFoundError(Exception):
|
|
"""Исключение, возникающее когда пользователь не найден в базе данных"""
|
|
pass
|
|
|
|
|
|
class PublishError(Exception):
|
|
"""Общее исключение для ошибок публикации"""
|
|
pass
|
|
|
|
|
|
class BanError(Exception):
|
|
"""Исключение для ошибок бана/разбана пользователей"""
|
|
pass
|