feat: add new custom 500 exceptions
This commit is contained in:
@@ -8,3 +8,6 @@ from src.application.domain.exceptions.internal_exception import InternalExcepti
|
||||
from src.application.domain.exceptions.service_unavailable_exception import ServiceUnavailableException
|
||||
from src.application.domain.exceptions.too_many_requests_exception import TooManyRequestsException
|
||||
from src.application.domain.exceptions.csrf_error_exception import CsrfErrorException
|
||||
from src.application.domain.exceptions.jwt_error_exception import JwtErrorException
|
||||
from src.application.domain.exceptions.data_base_error_exception import DataBaseErrorException
|
||||
from src.application.domain.exceptions.rate_limit_error_exception import RateLimitErrorException
|
||||
@@ -0,0 +1,8 @@
|
||||
from src.application.domain.exceptions.application_exceptions import ApplicationException
|
||||
|
||||
from typing import Mapping
|
||||
|
||||
|
||||
class DataBaseErrorException(ApplicationException):
|
||||
def __init__(self, message: str = 'Database error occurred', headers: Mapping[str, str] | None = None):
|
||||
super().__init__(500, message, headers)
|
||||
8
src/application/domain/exceptions/jwt_error_exception.py
Normal file
8
src/application/domain/exceptions/jwt_error_exception.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from src.application.domain.exceptions.application_exceptions import ApplicationException
|
||||
|
||||
from typing import Mapping
|
||||
|
||||
|
||||
class JwtErrorException(ApplicationException):
|
||||
def __init__(self, message: str = 'JWT error occurred', headers: Mapping[str, str] | None = None):
|
||||
super().__init__(500, message, headers)
|
||||
@@ -0,0 +1,8 @@
|
||||
from src.application.domain.exceptions.application_exceptions import ApplicationException
|
||||
|
||||
from typing import Mapping
|
||||
|
||||
|
||||
class RateLimitErrorException(ApplicationException):
|
||||
def __init__(self, message: str = 'Rate limit error occurred', headers: Mapping[str, str] | None = None):
|
||||
super().__init__(500, message, headers)
|
||||
Reference in New Issue
Block a user