Coverage for pyquickhelper/helpgen/helpgen_exceptions.py: 83%

12 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-06-03 02:21 +0200

1""" 

2@file 

3@brief Exception raised by the automated documentation 

4 

5""" 

6 

7 

8class HelpGenException(Exception): 

9 

10 """ 

11 custom exception 

12 """ 

13 

14 def __init__(self, message, file=None): 

15 """ 

16 redefines the message sent to an exception 

17 

18 @param message message 

19 @param file filename 

20 """ 

21 if file is None: 

22 Exception.__init__(self, message) 

23 else: 

24 mes = f'{message}\n File "{file}", line 1' 

25 Exception.__init__(self, mes) 

26 

27 

28class ImportErrorHelpGen(ImportError): 

29 

30 """ 

31 A custom exception to detect a specific location when 

32 *ImportError* happens in the process. 

33 """ 

34 pass 

35 

36 

37class HelpGenConvertError(Exception): 

38 

39 """ 

40 Exception raised when a conversion failed. 

41 """ 

42 pass 

43 

44 

45class NotebookConvertError(Exception): 

46 

47 """ 

48 Exception raised when a conversion failed. 

49 """ 

50 pass