feat: add new custom 500 exceptions

This commit is contained in:
2026-06-01 15:07:44 +03:00
parent a1b41e8317
commit 35b968d288
8 changed files with 39 additions and 12 deletions

View File

@@ -7,7 +7,7 @@ from fastapi import Request
from redis.asyncio.client import Redis
from src.application.contracts import ILogger
from src.application.domain.exceptions import (
InternalException,
RateLimitErrorException,
ServiceUnavailableException,
TooManyRequestsException,
)
@@ -128,7 +128,7 @@ def rate_limit(
ident = _call_key_builder(key_builder, request, args, kwargs) # type: ignore[arg-type]
except Exception as e:
logger.error(f'RateLimit key_builder failed error={str(e)}')
raise InternalException(message='Rate limiter key_builder failed')
raise RateLimitErrorException(message='Rate limiter key_builder failed')
route = request.url.path
method = request.method