Coverage for src / lexigram / contracts / exceptions / middleware.py: 0%

9 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-08-15 18:57 +0800

1"""Middleware exceptions contract.""" 

2 

3from __future__ import annotations 

4 

5from typing import Any 

6 

7from lexigram.contracts.exceptions.base import LexigramError 

8 

9 

10class MiddlewareGuardError(LexigramError): 

11 """Raised when a middleware guard denies access.""" 

12 

13 _code = "LEX_ERR_MW_001" 

14 

15 def __init__( 

16 self, 

17 message: str = "Access denied", 

18 guard: Any | None = None, 

19 ) -> None: 

20 super().__init__(message) 

21 self.guard = guard 

22 

23 

24__all__ = ["MiddlewareGuardError"]