Coverage for src / ezcompiler / shared / exceptions / utils / file_exceptions.py: 100.00%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-03-27 06:49 +0000

1# /////////////////////////////////////////////////////////////// 

2# FILE_EXCEPTIONS - File operation exceptions 

3# Project: ezcompiler 

4# /////////////////////////////////////////////////////////////// 

5 

6""" 

7File exceptions - Specialized exceptions for file operations. 

8 

9This module defines exceptions for various file operation failures 

10used by FileUtils and other file-related utilities. 

11""" 

12 

13from __future__ import annotations 

14 

15# /////////////////////////////////////////////////////////////// 

16# IMPORTS 

17# /////////////////////////////////////////////////////////////// 

18from .base import EzCompilerError 

19 

20# /////////////////////////////////////////////////////////////// 

21# EXCEPTIONS 

22# /////////////////////////////////////////////////////////////// 

23 

24 

25class FileError(EzCompilerError): 

26 """Base exception for file operation errors.""" 

27 

28 

29class FileNotFoundError(FileError): 

30 """Raised when a file or directory cannot be found.""" 

31 

32 

33class DirectoryCreationError(FileError): 

34 """Raised when directory creation fails.""" 

35 

36 

37class FileAccessError(FileError): 

38 """Raised when file access is denied or fails.""" 

39 

40 

41class FileCopyError(FileError): 

42 """Raised when file copy operation fails.""" 

43 

44 

45class FileMoveError(FileError): 

46 """Raised when file move operation fails.""" 

47 

48 

49class FileDeleteError(FileError): 

50 """Raised when file deletion fails.""" 

51 

52 

53class DirectoryListError(FileError): 

54 """Raised when directory listing fails.""" 

55 

56 

57class PathNormalizationError(FileError): 

58 """Raised when path normalization fails."""