Coverage for src/lexigram/admin/actions/exceptions.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-24 23:39 +0800

1"""Action exceptions for lexigram-admin. 

2 

3Provides domain-specific exception classes for the action subsystem. 

4All exceptions inherit from AdminError to ensure consistent error 

5handling across the admin package. 

6""" 

7 

8from __future__ import annotations 

9 

10from lexigram.admin.exceptions import AdminError 

11 

12 

13class ActionError(AdminError): 

14 """Base exception for all action-related errors.""" 

15 

16 _code = "LEX_ERR_ADMIN_ACTION_001" 

17 

18 

19class PermissionDenied(ActionError): # noqa: N818 

20 """Raised when a user lacks permission to execute an action.""" 

21 

22 _code = "LEX_ERR_ADMIN_ACTION_002" 

23 

24 

25__all__ = [ 

26 "ActionError", 

27 "PermissionDenied", 

28]