Coverage for dao/exceptions.py: 50.00%

6 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2026-04-15 13:02 +0000

1"""DAO-level exceptions for better error handling.""" 

2 

3 

4class DAOError(Exception): 

5 """Base exception for DAO operations.""" 

6 

7 pass 

8 

9 

10class DuplicateRecordError(DAOError): 

11 """Raised when attempting to insert a duplicate record.""" 

12 

13 def __init__(self, message: str = "Record already exists", details: str | None = None): 

14 self.message = message 

15 self.details = details 

16 super().__init__(self.message)