Fix architecture issues from todolist
- Add documentation warnings for in-memory rate limiting and failed login attempts - Consolidate duplicate health endpoints into api/health.py - Fix CLI to use correct async rescan method names - Update download.py and anime.py to use custom exception classes - Add WebSocket room validation and rate limiting
This commit is contained in:
@@ -144,6 +144,23 @@ class ConflictError(AniWorldAPIException):
|
||||
)
|
||||
|
||||
|
||||
class BadRequestError(AniWorldAPIException):
|
||||
"""Exception raised for bad request (400) errors."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
message: str = "Bad request",
|
||||
details: Optional[Dict[str, Any]] = None,
|
||||
):
|
||||
"""Initialize bad request error."""
|
||||
super().__init__(
|
||||
message=message,
|
||||
status_code=400,
|
||||
error_code="BAD_REQUEST",
|
||||
details=details,
|
||||
)
|
||||
|
||||
|
||||
class RateLimitError(AniWorldAPIException):
|
||||
"""Exception raised when rate limit is exceeded."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user