Coverage for structured_tutorials / errors.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-02 21:10 +0200

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 RunTutorialException(StructuredTutorialError): 

12 """Exception that is raised when we capture an exception while running (and not yet cleaning up).""" 

13 

14 

15class InvalidAlternativesSelectedError(StructuredTutorialError): 

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

17 

18 

19class ConfigurationException(RunTutorialException): 

20 """Exception raised when a configuration error occurs.""" 

21 

22 

23class RequiredExecutableNotFoundError(ConfigurationException): 

24 """Exception raised when a required executable is not found.""" 

25 

26 

27class PartError(StructuredTutorialError): 

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

29 

30 

31class CommandsPartError(PartError): 

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

33 

34 

35class CommandTestError(CommandsPartError): 

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

37 

38 

39class CommandOutputTestError(CommandTestError): 

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

41 

42 

43class FilePartError(PartError): 

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

45 

46 

47class DestinationIsADirectoryError(FilePartError): 

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

49 

50 

51class PromptNotConfirmedError(PartError): 

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