feat: add 500 csrf exception

This commit is contained in:
2026-05-29 14:34:02 +03:00
parent 48e917eece
commit a1b41e8317
3 changed files with 11 additions and 2 deletions

View File

@@ -7,3 +7,4 @@ from src.application.domain.exceptions.conflict_exception import ConflictExcepti
from src.application.domain.exceptions.internal_exception import InternalException
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

View File

@@ -0,0 +1,8 @@
from src.application.domain.exceptions.application_exceptions import ApplicationException
from typing import Mapping
class CsrfErrorException(ApplicationException):
def __init__(self, message: str = 'CSRF context is invalid', headers: Mapping[str, str] | None = None):
super().__init__(500, message, headers)