Coverage for src/galaxy_beep_frame/exception/converter/invalid_byte.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-08-31 04:18 +0200

1"""InvalidByteError class.""" 

2 

3from .lexer import LexerError 

4 

5 

6class InvalidByteError(LexerError): 

7 """Invalid byte received.""" 

8 

9 def __init__(self, value: int, possible_values: str) -> None: 

10 """ 

11 Error initialization. 

12 

13 Parameters 

14 ---------- 

15 value: int 

16 The invalid byte. 

17 possible_values: str 

18 Name of the possible values (eg. "numeric") 

19 

20 """ 

21 

22 super().__init__( 

23 f"Unknown byte: {chr(value)} not {possible_values}." 

24 )