]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/Common/BuildToolError.py
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / BaseTools / Source / Python / Common / BuildToolError.py
1 ## @file
2 # Standardized Error Handling infrastructures.
3 #
4 # Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
5 # SPDX-License-Identifier: BSD-2-Clause-Patent
6 #
7
8 FILE_OPEN_FAILURE = 1
9 FILE_WRITE_FAILURE = 2
10 FILE_PARSE_FAILURE = 3
11 FILE_READ_FAILURE = 4
12 FILE_CREATE_FAILURE = 5
13 FILE_CHECKSUM_FAILURE = 6
14 FILE_COMPRESS_FAILURE = 7
15 FILE_DECOMPRESS_FAILURE = 8
16 FILE_MOVE_FAILURE = 9
17 FILE_DELETE_FAILURE = 10
18 FILE_COPY_FAILURE = 11
19 FILE_POSITIONING_FAILURE = 12
20 FILE_ALREADY_EXIST = 13
21 FILE_NOT_FOUND = 14
22 FILE_TYPE_MISMATCH = 15
23 FILE_CASE_MISMATCH = 16
24 FILE_DUPLICATED = 17
25 FILE_UNKNOWN_ERROR = 0x0FFF
26
27 OPTION_UNKNOWN = 0x1000
28 OPTION_MISSING = 0x1001
29 OPTION_CONFLICT = 0x1002
30 OPTION_VALUE_INVALID = 0x1003
31 OPTION_DEPRECATED = 0x1004
32 OPTION_NOT_SUPPORTED = 0x1005
33 OPTION_UNKNOWN_ERROR = 0x1FFF
34
35 PARAMETER_INVALID = 0x2000
36 PARAMETER_MISSING = 0x2001
37 PARAMETER_UNKNOWN_ERROR =0x2FFF
38
39 FORMAT_INVALID = 0x3000
40 FORMAT_NOT_SUPPORTED = 0x3001
41 FORMAT_UNKNOWN = 0x3002
42 FORMAT_UNKNOWN_ERROR = 0x3FFF
43
44 RESOURCE_NOT_AVAILABLE = 0x4000
45 RESOURCE_ALLOCATE_FAILURE = 0x4001
46 RESOURCE_FULL = 0x4002
47 RESOURCE_OVERFLOW = 0x4003
48 RESOURCE_UNDERRUN = 0x4004
49 RESOURCE_UNKNOWN_ERROR = 0x4FFF
50
51 ATTRIBUTE_NOT_AVAILABLE = 0x5000
52 ATTRIBUTE_GET_FAILURE = 0x5001
53 ATTRIBUTE_SET_FAILURE = 0x5002
54 ATTRIBUTE_UPDATE_FAILURE = 0x5003
55 ATTRIBUTE_ACCESS_DENIED = 0x5004
56 ATTRIBUTE_UNKNOWN_ERROR = 0x5FFF
57
58 IO_NOT_READY = 0x6000
59 IO_BUSY = 0x6001
60 IO_TIMEOUT = 0x6002
61 IO_UNKNOWN_ERROR = 0x6FFF
62
63 COMMAND_FAILURE = 0x7000
64
65 PERMISSION_FAILURE = 0x8000
66
67 FV_FREESIZE_ERROR = 0x9000
68
69 CODE_ERROR = 0xC0DE
70
71 AUTOGEN_ERROR = 0xF000
72 PARSER_ERROR = 0xF001
73 BUILD_ERROR = 0xF002
74 GENFDS_ERROR = 0xF003
75 ECC_ERROR = 0xF004
76 EOT_ERROR = 0xF005
77 PREBUILD_ERROR = 0xF007
78 POSTBUILD_ERROR = 0xF008
79 DDC_ERROR = 0xF009
80 WARNING_AS_ERROR = 0xF006
81 MIGRATION_ERROR = 0xF010
82 PCD_VALIDATION_INFO_ERROR = 0xF011
83 PCD_VARIABLE_ATTRIBUTES_ERROR = 0xF012
84 PCD_VARIABLE_INFO_ERROR = 0xF016
85 PCD_VARIABLE_ATTRIBUTES_CONFLICT_ERROR = 0xF013
86 PCD_STRUCTURE_PCD_INVALID_FIELD_ERROR = 0xF014
87 PCD_STRUCTURE_PCD_ERROR = 0xF015
88 ERROR_STATEMENT = 0xFFFD
89 ABORT_ERROR = 0xFFFE
90 UNKNOWN_ERROR = 0xFFFF
91
92 ## Error message of each error code
93 gErrorMessage = {
94 FILE_NOT_FOUND : "File/directory not found in workspace",
95 FILE_OPEN_FAILURE : "File open failure",
96 FILE_WRITE_FAILURE : "File write failure",
97 FILE_PARSE_FAILURE : "File parse failure",
98 FILE_READ_FAILURE : "File read failure",
99 FILE_CREATE_FAILURE : "File create failure",
100 FILE_CHECKSUM_FAILURE : "Invalid checksum of file",
101 FILE_COMPRESS_FAILURE : "File compress failure",
102 FILE_DECOMPRESS_FAILURE : "File decompress failure",
103 FILE_MOVE_FAILURE : "File move failure",
104 FILE_DELETE_FAILURE : "File delete failure",
105 FILE_COPY_FAILURE : "File copy failure",
106 FILE_POSITIONING_FAILURE: "Failed to seeking position",
107 FILE_ALREADY_EXIST : "File or directory already exists",
108 FILE_TYPE_MISMATCH : "Incorrect file type",
109 FILE_CASE_MISMATCH : "File name case mismatch",
110 FILE_DUPLICATED : "Duplicated file found",
111 FILE_UNKNOWN_ERROR : "Unknown error encountered on file",
112
113 OPTION_UNKNOWN : "Unknown option",
114 OPTION_MISSING : "Missing option",
115 OPTION_CONFLICT : "Conflict options",
116 OPTION_VALUE_INVALID : "Invalid value of option",
117 OPTION_DEPRECATED : "Deprecated option",
118 OPTION_NOT_SUPPORTED : "Unsupported option",
119 OPTION_UNKNOWN_ERROR : "Unknown error when processing options",
120
121 PARAMETER_INVALID : "Invalid parameter",
122 PARAMETER_MISSING : "Missing parameter",
123 PARAMETER_UNKNOWN_ERROR : "Unknown error in parameters",
124
125 FORMAT_INVALID : "Invalid syntax/format",
126 FORMAT_NOT_SUPPORTED : "Not supported syntax/format",
127 FORMAT_UNKNOWN : "Unknown format",
128 FORMAT_UNKNOWN_ERROR : "Unknown error in syntax/format ",
129
130 RESOURCE_NOT_AVAILABLE : "Not available",
131 RESOURCE_ALLOCATE_FAILURE : "Allocate failure",
132 RESOURCE_FULL : "Full",
133 RESOURCE_OVERFLOW : "Overflow",
134 RESOURCE_UNDERRUN : "Underrun",
135 RESOURCE_UNKNOWN_ERROR : "Unknown error",
136
137 ATTRIBUTE_NOT_AVAILABLE : "Not available",
138 ATTRIBUTE_GET_FAILURE : "Failed to retrieve",
139 ATTRIBUTE_SET_FAILURE : "Failed to set",
140 ATTRIBUTE_UPDATE_FAILURE: "Failed to update",
141 ATTRIBUTE_ACCESS_DENIED : "Access denied",
142 ATTRIBUTE_UNKNOWN_ERROR : "Unknown error when accessing",
143
144 COMMAND_FAILURE : "Failed to execute command",
145
146 IO_NOT_READY : "Not ready",
147 IO_BUSY : "Busy",
148 IO_TIMEOUT : "Timeout",
149 IO_UNKNOWN_ERROR : "Unknown error in IO operation",
150
151 ERROR_STATEMENT : "!error statement",
152 UNKNOWN_ERROR : "Unknown error",
153 }
154
155 ## Exception indicating a fatal error
156 class FatalError(Exception):
157 pass
158
159 if __name__ == "__main__":
160 pass