Coverage for src / tracekit / exceptions.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-11 23:04 +0000

1"""TraceKit exception hierarchy - DEPRECATED compatibility module. 

2 

3.. deprecated:: 1.0.0 

4 This module is deprecated for backward compatibility only. 

5 New code MUST import from `tracekit.core.exceptions` directly. 

6 This module will be removed in a future major version. 

7 

8This module re-exports exceptions from tracekit.core.exceptions. 

9The canonical location for all exception classes is `tracekit.core.exceptions`. 

10 

11Why two files exist: 

12 - `tracekit/core/exceptions.py`: Canonical implementation of all exception classes 

13 - `tracekit/exceptions.py` (this file): Deprecated re-export for backward compatibility 

14 

15Migration guide: 

16 Old (deprecated): 

17 from tracekit.exceptions import LoaderError 

18 

19 New (preferred): 

20 from tracekit.core.exceptions import LoaderError 

21""" 

22 

23import warnings 

24 

25# Issue deprecation warning on import 

26warnings.warn( 

27 "tracekit.exceptions is deprecated. " 

28 "Import from tracekit.core.exceptions instead. " 

29 "This module will be removed in a future major version.", 

30 DeprecationWarning, 

31 stacklevel=2, 

32) 

33 

34# Re-export all exceptions from core.exceptions 

35from tracekit.core.exceptions import ( # noqa: E402 

36 AnalysisError, 

37 ConfigurationError, 

38 ExportError, 

39 FormatError, 

40 InsufficientDataError, 

41 LoaderError, 

42 SampleRateError, 

43 TraceKitError, 

44 UnsupportedFormatError, 

45 ValidationError, 

46) 

47 

48__all__ = [ 

49 "AnalysisError", 

50 "ConfigurationError", 

51 "ExportError", 

52 "FormatError", 

53 "InsufficientDataError", 

54 "LoaderError", 

55 "SampleRateError", 

56 "TraceKitError", 

57 "UnsupportedFormatError", 

58 "ValidationError", 

59]