Coverage for src / ezqt_app / domain / errors / base.py: 90.91%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-06 13:12 +0000

1# /////////////////////////////////////////////////////////////// 

2# DOMAIN.ERRORS.BASE - Base domain exceptions 

3# Project: ezqt_app 

4# /////////////////////////////////////////////////////////////// 

5 

6"""Base exception hierarchy for ezqt_app.""" 

7 

8from __future__ import annotations 

9 

10# /////////////////////////////////////////////////////////////// 

11# IMPORTS 

12# /////////////////////////////////////////////////////////////// 

13# Standard library imports 

14from dataclasses import dataclass 

15 

16# Local imports 

17from ...shared.types import JsonMap 

18 

19 

20# /////////////////////////////////////////////////////////////// 

21# DATACLASSES 

22# /////////////////////////////////////////////////////////////// 

23@dataclass(slots=True) 

24class EzQtError(Exception): 

25 """Base typed exception for all application-specific errors.""" 

26 

27 code: str 

28 message: str 

29 context: JsonMap | None = None 

30 

31 def __str__(self) -> str: 

32 return self.message 

33 

34 

35class DomainError(EzQtError): 

36 """Base domain-layer error."""