@@ -38,6 +38,7 @@ def OptionNameIsNone():
3838 def OptionNameHasBadType (nameType : type ):
3939 assert nameType is not None
4040 assert type (nameType ) == type
41+
4142 errMsg = "Option name has nad type [{0}]" .format (nameType .__name__ )
4243 raise Exception (errMsg )
4344
@@ -55,6 +56,7 @@ def NoneValueIsNotSupported():
5556 def NoneOptionValueItemIsNotSupported (optionName : str ):
5657 assert type (optionName ) == str
5758 assert optionName != ""
59+
5860 errMsg = "None value item of option [{0}] is not supported." .format (optionName )
5961 raise Exception (errMsg )
6062
@@ -92,7 +94,6 @@ def BadOptionValueType(optionName: str, optionValueType: type, expectedType: typ
9294 errMsg = "Bad option [{0}] value type [{1}]. Expected type is [{2}]." .format (
9395 optionName , optionValueType .__name__ , expectedType .__name__
9496 )
95-
9697 raise Exception (errMsg )
9798
9899 # --------------------------------------------------------------------
@@ -106,7 +107,6 @@ def CantConvertOptionValue(optionName: str, sourceType: type, targetType: type):
106107 optionName , sourceType .__name__ , targetType .__name__
107108 )
108109 )
109-
110110 raise Exception (errMsg )
111111
112112 # --------------------------------------------------------------------
@@ -122,7 +122,6 @@ def BadOptionValueItemType(
122122 optionName , optionValueItemType .__name__ , expectedType .__name__
123123 )
124124 )
125-
126125 raise Exception (errMsg )
127126
128127 # --------------------------------------------------------------------
@@ -145,7 +144,6 @@ def OptionIsAlreadyExistInThisFile(filePath: str, optionName: str):
145144 errMsg = "Option [{0}] already exist in this file [{1}]." .format (
146145 optionName , filePath
147146 )
148-
149147 raise Exception (errMsg )
150148
151149 # --------------------------------------------------------------------
@@ -158,7 +156,6 @@ def OptionIsAlreadyExistInAnotherFile(filePath: str, optionName: str):
158156 errMsg = "Option [{0}] already exist in another file [{1}]." .format (
159157 optionName , filePath
160158 )
161-
162159 raise Exception (errMsg )
163160
164161 # --------------------------------------------------------------------
@@ -171,7 +168,6 @@ def OptionIsAlreadyExistInFile(filePath: str, optionName: str):
171168 errMsg = "Option [{0}] already exist in the file [{1}]." .format (
172169 optionName , filePath
173170 )
174-
175171 raise Exception (errMsg )
176172
177173 # --------------------------------------------------------------------
@@ -182,7 +178,6 @@ def OptionValueItemIsAlreadyDefined(filePath: str, optName: str, valueItem: any)
182178 errMsg = "Another definition of option [{1}] value item [{2}] is found in the file [{0}]." .format (
183179 filePath , optName , valueItem
184180 )
185-
186181 raise Exception (errMsg )
187182
188183 # --------------------------------------------------------------------
@@ -195,7 +190,6 @@ def OptionValueItemIsAlreadyDefinedInAnotherFile(
195190 errMsg = "Definition of option [{1}] value item [{2}] is found in another file [{0}]." .format (
196191 filePath , optName , valueItem
197192 )
198-
199193 raise Exception (errMsg )
200194
201195 # --------------------------------------------------------------------
@@ -233,21 +227,18 @@ def FileWasModifiedExternally(
233227 errMsg = "File [{0}] was modified externally. Our timestamp is [{1}]. The current file timestamp is [{2}]." .format (
234228 filePath , ourLastMDate , curLastMDate
235229 )
236-
237230 raise Exception (errMsg )
238231
239232 # --------------------------------------------------------------------
240233 def FileLineAlreadyHasComment ():
241234 errMsg = "File line already has a comment."
242-
243235 raise Exception (errMsg )
244236
245237 # --------------------------------------------------------------------
246238 def FileLineAlreadyHasOption (optionName : str ):
247239 assert type (optionName ) == str
248240
249241 errMsg = "File line already has the option [{0}]." .format (optionName )
250-
251242 raise Exception (errMsg )
252243
253244 # --------------------------------------------------------------------
@@ -265,7 +256,6 @@ def CfgReader__UnexpectedSymbol(lineNum: int, colNum: int, ch: str):
265256 errMsg = "Unexpected symbol in line {0}, column {1}: [{2}]" .format (
266257 lineNum , colNum , ch
267258 )
268-
269259 raise Exception (errMsg )
270260
271261 # --------------------------------------------------------------------
@@ -274,7 +264,6 @@ def CfgReader__IncludeWithoutPath(lineNum: int):
274264 assert lineNum >= 0
275265
276266 errMsg = "Include directive in line {0} does not have a path." .format (lineNum )
277-
278267 raise Exception (errMsg )
279268
280269 # --------------------------------------------------------------------
@@ -283,7 +272,6 @@ def CfgReader__EndOfIncludePathIsNotFound(lineNum: int):
283272 assert lineNum >= 0
284273
285274 errMsg = "The end of an include path is not found. Line {0}." .format (lineNum )
286-
287275 raise Exception (errMsg )
288276
289277 # --------------------------------------------------------------------
@@ -292,7 +280,6 @@ def CfgReader__IncompletedEscapeInInclude(lineNum: int):
292280 assert lineNum >= 0
293281
294282 errMsg = "Escape in an include path is not completed. Line {0}." .format (lineNum )
295-
296283 raise Exception (errMsg )
297284
298285 # --------------------------------------------------------------------
@@ -307,7 +294,6 @@ def CfgReader__UnknownEscapedSymbolInInclude(lineNum: int, colNum: int, ch: str)
307294 errMsg = "Unknown escape symbol [{2}] in an include path. Line {0}. Column {1}." .format (
308295 lineNum , colNum , ch
309296 )
310-
311297 raise Exception (errMsg )
312298
313299 # --------------------------------------------------------------------
@@ -316,7 +302,6 @@ def CfgReader__IncludeHasEmptyPath(lineNum: int):
316302 assert lineNum >= 0
317303
318304 errMsg = "Include in line {0} has an empty path." .format (lineNum )
319-
320305 raise Exception (errMsg )
321306
322307 # --------------------------------------------------------------------
@@ -329,7 +314,6 @@ def CfgReader__OptionWithoutValue(optionName: str, lineNum: int):
329314 errMsg = "Option [{0}] in line {1} does not have a value." .format (
330315 optionName , lineNum
331316 )
332-
333317 raise Exception (errMsg )
334318
335319 # --------------------------------------------------------------------
@@ -342,7 +326,6 @@ def CfgReader__EndQuotedOptionValueIsNotFound(optionName: str, lineNum: int):
342326 errMsg = "Value of quoted option [{0}] is not completed. Line {1}." .format (
343327 optionName , lineNum
344328 )
345-
346329 raise Exception (errMsg )
347330
348331 # --------------------------------------------------------------------
@@ -355,7 +338,6 @@ def CfgReader__IncompletedEscapeInQuotedOptionValue(optionName: str, lineNum: in
355338 errMsg = "Escape in a value of quoted option [{0}] is not completed. Line {1}." .format (
356339 optionName , lineNum
357340 )
358-
359341 raise Exception (errMsg )
360342
361343 # --------------------------------------------------------------------
@@ -372,13 +354,11 @@ def CfgReader__UnknownEscapedSymbolInQuotedOptionValue(
372354 errMsg = "Unknown escape symbol [{3}] in a value of quoted option [{0}]. Line {1}. Column {2}." .format (
373355 optionName , lineNum , colNum , ch
374356 )
375-
376357 raise Exception (errMsg )
377358
378359 # --------------------------------------------------------------------
379360 def BadFormatOfCommaSeparatedList ():
380361 errMsg = "Bad format of comma separated list."
381-
382362 raise Exception (errMsg )
383363
384364
0 commit comments