-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.py
More file actions
94 lines (56 loc) · 2.36 KB
/
error.py
File metadata and controls
94 lines (56 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
from bcolors import *
# status = -1
def fs_corrupted():
print(f"{bcolors.FAIL}Error: Your file system is corrupted or not found!!"
f"\nRe-initialize your system by running initialize_fs.py{bcolors.ENDC}")
exit(0)
# status = -2
def wrong_argument():
print(f"{bcolors.FAIL}Error: Please check your arguments!!{bcolors.ENDC}")
return
# status = -3
def wrong_command():
print(f"{bcolors.FAIL}Error: Command not found!!{bcolors.ENDC}")
return
# status = -4
def fname_not_in_dir():
print(f"{bcolors.FAIL}Error: File name is not present in current directory!!{bcolors.ENDC}")
return
# status = -5
def file_not_a_dir():
print(f"{bcolors.FAIL}Error: File not a directory!!!!{bcolors.ENDC}")
# status = -6
def disks_error():
print(f"{bcolors.FAIL}Error: Number of disks can not be greater than total inode entries!!{bcolors.ENDC}")
# status = -7
def free_space_not_found():
print(f"{bcolors.FAIL}Error: Entire disk is used up and no free space is found for new entry!!{bcolors.ENDC}")
# status = -8
def out_of_scope_memory_accessed_in_file():
print(f"{bcolors.FAIL}Error: Location accessed is not present within this file!!{bcolors.ENDC}")
# status = -9
def trimming_empty_file():
print(f"{bcolors.FAIL}Error: You can not trim empty file!!{bcolors.ENDC}")
# status = -10
def operation_not_for_folders():
print(f"{bcolors.FAIL}Error: This operation can not be performed on folders/directories!!{bcolors.ENDC}")
# status = -11
def file_not_found():
print(f"{bcolors.FAIL}Error: Specified file or directory not found!!{bcolors.ENDC}")
# status = -12
def file_not_open():
print(f"{bcolors.FAIL}Error: Specified file not found in open file table!!{bcolors.ENDC}")
# status = -13
def file_already_open():
print(f"{bcolors.FAIL}Error: Specified file is already present in open file table!!{bcolors.ENDC}")
# status = -14
def arguments_not_int():
print(f"{bcolors.FAIL}Error: Integer arguemnts were required but string given!!{bcolors.ENDC}")
# status = -15
def index_out_of_bound():
print(f"{bcolors.FAIL}Error: Index out of bound!!{bcolors.ENDC}")
# status = -21
def sock_couldnt_open():
print(f"{bcolors.FAIL}Error: Sock couldn't open, Possible cause include status -19 and status -20!!{bcolors.ENDC}")
# status = -19 -> already connected
# status = -20 -> connectionLimitAchieved