Coverage for structured_tutorials / errors.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2025-12-21 19:08 +0100

1# Copyright (c) 2025 Mathias Ertl 

2# Licensed under the MIT License. See LICENSE file for details. 

3 

4"""Collection of errors thrown by this project.""" 

5 

6 

7class StructuredTutorialError(Exception): 

8 """Base class for all exceptions thrown by this project.""" 

9 

10 

11class InvalidAlternativesSelectedError(StructuredTutorialError): 

12 """Exception raised when an invalid alternative is selected.""" 

13 

14 

15class PartError(StructuredTutorialError): 

16 """Base class for all errors happening in a specific part.""" 

17 

18 

19class CommandsPartError(PartError): 

20 """Base class for all errors happening in a specific commands part.""" 

21 

22 

23class CommandTestError(CommandsPartError): 

24 """Base class for exceptions when a test for a command fails.""" 

25 

26 

27class CommandOutputTestError(CommandTestError): 

28 """Exception raised when an output test fails.""" 

29 

30 

31class FilePartError(PartError): 

32 """Exception raised for errors in file parts.""" 

33 

34 

35class DestinationIsADirectoryError(FilePartError): 

36 """Exception raised when a destination is a directory.""" 

37 

38 

39class PromptNotConfirmedError(PartError): 

40 """Exception raised when a user does not confirm the current state in a prompt part."""