Files
call-review-platform/services/ingest-service/app/core/exceptions.py

30 lines
924 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""Кастомные исключения для приложения"""
class AppException(Exception):
"""Базовое исключение приложения"""
def __init__(self, message: str, details: dict = None):
self.message = message
self.details = details or {}
super().__init__(self.message)
class CallEventAlreadyExistsError(AppException):
"""Событие звонка с таким call_session_id уже существует"""
def __init__(self, call_session_id: int):
super().__init__(
message=f"Call event with session_id {call_session_id} already exists",
details={"call_session_id": call_session_id}
)
class DatabaseError(AppException):
"""Ошибка работы с базой данных"""
pass
class ValidationError(AppException):
"""Ошибка валидации данных"""
pass