feat: add new custom 500 exceptions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user