- 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.
12 lines
289 B
Python
12 lines
289 B
Python
"""Custom exceptions for group handlers"""
|
|
|
|
|
|
class NoReplyToMessageError(Exception):
|
|
"""Raised when admin tries to reply without selecting a message"""
|
|
pass
|
|
|
|
|
|
class UserNotFoundError(Exception):
|
|
"""Raised when user is not found in database for the given message_id"""
|
|
pass
|